aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-16 15:23:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-16 15:23:18 -0500
commitb29c8306a368cf65782669eba079f81dc861c54d (patch)
tree35d75aa0e671070d4024f11338d3ae89b078b1ed /include/linux
parent0bde7294e2ada03d0f1cc61cec51274081d9a9cf (diff)
parent3a81a5210b7d33bb6d836b4c4952a54166a336f3 (diff)
Merge tag 'trace-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing update from Steven Rostedt: "This batch of changes is mostly clean ups and small bug fixes. The only real feature that was added this release is from Namhyung Kim, who introduced "set_graph_notrace" filter that lets you run the function graph tracer and not trace particular functions and their call chain. Tom Zanussi added some updates to the ftrace multibuffer tracing that made it more consistent with the top level tracing. One of the fixes for perf function tracing required an API change in RCU; the addition of "rcu_is_watching()". As Paul McKenney is pushing that change in this release too, he gave me a branch that included all the changes to get that working, and I pulled that into my tree in order to complete the perf function tracing fix" * tag 'trace-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Add rcu annotation for syscall trace descriptors tracing: Do not use signed enums with unsigned long long in fgragh output tracing: Remove unused function ftrace_off_permanent() tracing: Do not assign filp->private_data to freed memory tracing: Add helper function tracing_is_disabled() tracing: Open tracer when ftrace_dump_on_oops is used tracing: Add support for SOFT_DISABLE to syscall events tracing: Make register/unregister_ftrace_command __init tracing: Update event filters for multibuffer recordmcount.pl: Add support for __fentry__ ftrace: Have control op function callback only trace when RCU is watching rcu: Do not trace rcu_is_watching() functions ftrace/x86: skip over the breakpoint for ftrace caller trace/trace_stat: use rbtree postorder iteration helper instead of opencoding ftrace: Add set_graph_notrace filter ftrace: Narrow down the protected area of graph_lock ftrace: Introduce struct ftrace_graph_data ftrace: Get rid of ftrace_graph_filter_enabled tracing: Fix potential out-of-bounds in trace_get_user() tracing: Show more exact help information about snapshot
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ftrace.h5
-rw-r--r--include/linux/ftrace_event.h25
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/syscalls.h4
4 files changed, 25 insertions, 11 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 9f15c0064c50..31ea4b428360 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -533,11 +533,11 @@ static inline int ftrace_force_update(void) { return 0; }
533static inline void ftrace_disable_daemon(void) { } 533static inline void ftrace_disable_daemon(void) { }
534static inline void ftrace_enable_daemon(void) { } 534static inline void ftrace_enable_daemon(void) { }
535static inline void ftrace_release_mod(struct module *mod) {} 535static inline void ftrace_release_mod(struct module *mod) {}
536static inline int register_ftrace_command(struct ftrace_func_command *cmd) 536static inline __init int register_ftrace_command(struct ftrace_func_command *cmd)
537{ 537{
538 return -EINVAL; 538 return -EINVAL;
539} 539}
540static inline int unregister_ftrace_command(char *cmd_name) 540static inline __init int unregister_ftrace_command(char *cmd_name)
541{ 541{
542 return -EINVAL; 542 return -EINVAL;
543} 543}
@@ -721,6 +721,7 @@ ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth,
721extern char __irqentry_text_start[]; 721extern char __irqentry_text_start[];
722extern char __irqentry_text_end[]; 722extern char __irqentry_text_end[];
723 723
724#define FTRACE_NOTRACE_DEPTH 65536
724#define FTRACE_RETFUNC_DEPTH 50 725#define FTRACE_RETFUNC_DEPTH 50
725#define FTRACE_RETSTACK_ALLOC_SIZE 32 726#define FTRACE_RETSTACK_ALLOC_SIZE 32
726extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, 727extern int register_ftrace_graph(trace_func_graph_ret_t retfunc,
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 5eaa746735ff..9abbe630c456 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -202,6 +202,7 @@ enum {
202 TRACE_EVENT_FL_NO_SET_FILTER_BIT, 202 TRACE_EVENT_FL_NO_SET_FILTER_BIT,
203 TRACE_EVENT_FL_IGNORE_ENABLE_BIT, 203 TRACE_EVENT_FL_IGNORE_ENABLE_BIT,
204 TRACE_EVENT_FL_WAS_ENABLED_BIT, 204 TRACE_EVENT_FL_WAS_ENABLED_BIT,
205 TRACE_EVENT_FL_USE_CALL_FILTER_BIT,
205}; 206};
206 207
207/* 208/*
@@ -213,6 +214,7 @@ enum {
213 * WAS_ENABLED - Set and stays set when an event was ever enabled 214 * WAS_ENABLED - Set and stays set when an event was ever enabled
214 * (used for module unloading, if a module event is enabled, 215 * (used for module unloading, if a module event is enabled,
215 * it is best to clear the buffers that used it). 216 * it is best to clear the buffers that used it).
217 * USE_CALL_FILTER - For ftrace internal events, don't use file filter
216 */ 218 */
217enum { 219enum {
218 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), 220 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT),
@@ -220,6 +222,7 @@ enum {
220 TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), 222 TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT),
221 TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), 223 TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT),
222 TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT), 224 TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT),
225 TRACE_EVENT_FL_USE_CALL_FILTER = (1 << TRACE_EVENT_FL_USE_CALL_FILTER_BIT),
223}; 226};
224 227
225struct ftrace_event_call { 228struct ftrace_event_call {
@@ -238,6 +241,7 @@ struct ftrace_event_call {
238 * bit 2: failed to apply filter 241 * bit 2: failed to apply filter
239 * bit 3: ftrace internal event (do not enable) 242 * bit 3: ftrace internal event (do not enable)
240 * bit 4: Event was enabled by module 243 * bit 4: Event was enabled by module
244 * bit 5: use call filter rather than file filter
241 */ 245 */
242 int flags; /* static flags of different events */ 246 int flags; /* static flags of different events */
243 247
@@ -253,6 +257,8 @@ struct ftrace_subsystem_dir;
253enum { 257enum {
254 FTRACE_EVENT_FL_ENABLED_BIT, 258 FTRACE_EVENT_FL_ENABLED_BIT,
255 FTRACE_EVENT_FL_RECORDED_CMD_BIT, 259 FTRACE_EVENT_FL_RECORDED_CMD_BIT,
260 FTRACE_EVENT_FL_FILTERED_BIT,
261 FTRACE_EVENT_FL_NO_SET_FILTER_BIT,
256 FTRACE_EVENT_FL_SOFT_MODE_BIT, 262 FTRACE_EVENT_FL_SOFT_MODE_BIT,
257 FTRACE_EVENT_FL_SOFT_DISABLED_BIT, 263 FTRACE_EVENT_FL_SOFT_DISABLED_BIT,
258}; 264};
@@ -261,6 +267,8 @@ enum {
261 * Ftrace event file flags: 267 * Ftrace event file flags:
262 * ENABLED - The event is enabled 268 * ENABLED - The event is enabled
263 * RECORDED_CMD - The comms should be recorded at sched_switch 269 * RECORDED_CMD - The comms should be recorded at sched_switch
270 * FILTERED - The event has a filter attached
271 * NO_SET_FILTER - Set when filter has error and is to be ignored
264 * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED 272 * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED
265 * SOFT_DISABLED - When set, do not trace the event (even though its 273 * SOFT_DISABLED - When set, do not trace the event (even though its
266 * tracepoint may be enabled) 274 * tracepoint may be enabled)
@@ -268,6 +276,8 @@ enum {
268enum { 276enum {
269 FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), 277 FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT),
270 FTRACE_EVENT_FL_RECORDED_CMD = (1 << FTRACE_EVENT_FL_RECORDED_CMD_BIT), 278 FTRACE_EVENT_FL_RECORDED_CMD = (1 << FTRACE_EVENT_FL_RECORDED_CMD_BIT),
279 FTRACE_EVENT_FL_FILTERED = (1 << FTRACE_EVENT_FL_FILTERED_BIT),
280 FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT),
271 FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), 281 FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT),
272 FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), 282 FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT),
273}; 283};
@@ -275,6 +285,7 @@ enum {
275struct ftrace_event_file { 285struct ftrace_event_file {
276 struct list_head list; 286 struct list_head list;
277 struct ftrace_event_call *event_call; 287 struct ftrace_event_call *event_call;
288 struct event_filter *filter;
278 struct dentry *dir; 289 struct dentry *dir;
279 struct trace_array *tr; 290 struct trace_array *tr;
280 struct ftrace_subsystem_dir *system; 291 struct ftrace_subsystem_dir *system;
@@ -310,12 +321,16 @@ struct ftrace_event_file {
310 321
311#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ 322#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
312 323
313extern void destroy_preds(struct ftrace_event_call *call); 324extern void destroy_preds(struct ftrace_event_file *file);
325extern void destroy_call_preds(struct ftrace_event_call *call);
314extern int filter_match_preds(struct event_filter *filter, void *rec); 326extern int filter_match_preds(struct event_filter *filter, void *rec);
315extern int filter_current_check_discard(struct ring_buffer *buffer, 327
316 struct ftrace_event_call *call, 328extern int filter_check_discard(struct ftrace_event_file *file, void *rec,
317 void *rec, 329 struct ring_buffer *buffer,
318 struct ring_buffer_event *event); 330 struct ring_buffer_event *event);
331extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec,
332 struct ring_buffer *buffer,
333 struct ring_buffer_event *event);
319 334
320enum { 335enum {
321 FILTER_OTHER = 0, 336 FILTER_OTHER = 0,
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 672ddc4de4af..d4e98d13eff4 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -501,7 +501,6 @@ void tracing_snapshot_alloc(void);
501 501
502extern void tracing_start(void); 502extern void tracing_start(void);
503extern void tracing_stop(void); 503extern void tracing_stop(void);
504extern void ftrace_off_permanent(void);
505 504
506static inline __printf(1, 2) 505static inline __printf(1, 2)
507void ____trace_printk_check_format(const char *fmt, ...) 506void ____trace_printk_check_format(const char *fmt, ...)
@@ -639,7 +638,6 @@ extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
639#else 638#else
640static inline void tracing_start(void) { } 639static inline void tracing_start(void) { }
641static inline void tracing_stop(void) { } 640static inline void tracing_stop(void) { }
642static inline void ftrace_off_permanent(void) { }
643static inline void trace_dump_stack(int skip) { } 641static inline void trace_dump_stack(int skip) { }
644 642
645static inline void tracing_on(void) { } 643static inline void tracing_on(void) { }
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index c27f846f6b71..94273bbe6050 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -120,7 +120,7 @@ extern struct trace_event_functions exit_syscall_print_funcs;
120 .class = &event_class_syscall_enter, \ 120 .class = &event_class_syscall_enter, \
121 .event.funcs = &enter_syscall_print_funcs, \ 121 .event.funcs = &enter_syscall_print_funcs, \
122 .data = (void *)&__syscall_meta_##sname,\ 122 .data = (void *)&__syscall_meta_##sname,\
123 .flags = TRACE_EVENT_FL_CAP_ANY, \ 123 .flags = TRACE_EVENT_FL_CAP_ANY, \
124 }; \ 124 }; \
125 static struct ftrace_event_call __used \ 125 static struct ftrace_event_call __used \
126 __attribute__((section("_ftrace_events"))) \ 126 __attribute__((section("_ftrace_events"))) \
@@ -134,7 +134,7 @@ extern struct trace_event_functions exit_syscall_print_funcs;
134 .class = &event_class_syscall_exit, \ 134 .class = &event_class_syscall_exit, \
135 .event.funcs = &exit_syscall_print_funcs, \ 135 .event.funcs = &exit_syscall_print_funcs, \
136 .data = (void *)&__syscall_meta_##sname,\ 136 .data = (void *)&__syscall_meta_##sname,\
137 .flags = TRACE_EVENT_FL_CAP_ANY, \ 137 .flags = TRACE_EVENT_FL_CAP_ANY, \
138 }; \ 138 }; \
139 static struct ftrace_event_call __used \ 139 static struct ftrace_event_call __used \
140 __attribute__((section("_ftrace_events"))) \ 140 __attribute__((section("_ftrace_events"))) \