diff options
Diffstat (limited to 'kernel/trace/trace.h')
| -rw-r--r-- | kernel/trace/trace.h | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 02b592f2d4b7..2e29d7ba5a52 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/hw_breakpoint.h> | 13 | #include <linux/hw_breakpoint.h> |
| 14 | #include <linux/trace_seq.h> | 14 | #include <linux/trace_seq.h> |
| 15 | #include <linux/ftrace_event.h> | 15 | #include <linux/ftrace_event.h> |
| 16 | #include <linux/compiler.h> | ||
| 16 | 17 | ||
| 17 | #ifdef CONFIG_FTRACE_SYSCALLS | 18 | #ifdef CONFIG_FTRACE_SYSCALLS |
| 18 | #include <asm/unistd.h> /* For NR_SYSCALLS */ | 19 | #include <asm/unistd.h> /* For NR_SYSCALLS */ |
| @@ -210,6 +211,11 @@ struct trace_array { | |||
| 210 | struct list_head events; | 211 | struct list_head events; |
| 211 | cpumask_var_t tracing_cpumask; /* only trace on set CPUs */ | 212 | cpumask_var_t tracing_cpumask; /* only trace on set CPUs */ |
| 212 | int ref; | 213 | int ref; |
| 214 | #ifdef CONFIG_FUNCTION_TRACER | ||
| 215 | struct ftrace_ops *ops; | ||
| 216 | /* function tracing enabled */ | ||
| 217 | int function_enabled; | ||
| 218 | #endif | ||
| 213 | }; | 219 | }; |
| 214 | 220 | ||
| 215 | enum { | 221 | enum { |
| @@ -355,14 +361,16 @@ struct tracer { | |||
| 355 | void (*print_header)(struct seq_file *m); | 361 | void (*print_header)(struct seq_file *m); |
| 356 | enum print_line_t (*print_line)(struct trace_iterator *iter); | 362 | enum print_line_t (*print_line)(struct trace_iterator *iter); |
| 357 | /* If you handled the flag setting, return 0 */ | 363 | /* If you handled the flag setting, return 0 */ |
| 358 | int (*set_flag)(u32 old_flags, u32 bit, int set); | 364 | int (*set_flag)(struct trace_array *tr, |
| 365 | u32 old_flags, u32 bit, int set); | ||
| 359 | /* Return 0 if OK with change, else return non-zero */ | 366 | /* Return 0 if OK with change, else return non-zero */ |
| 360 | int (*flag_changed)(struct tracer *tracer, | 367 | int (*flag_changed)(struct trace_array *tr, |
| 361 | u32 mask, int set); | 368 | u32 mask, int set); |
| 362 | struct tracer *next; | 369 | struct tracer *next; |
| 363 | struct tracer_flags *flags; | 370 | struct tracer_flags *flags; |
| 371 | int enabled; | ||
| 364 | bool print_max; | 372 | bool print_max; |
| 365 | bool enabled; | 373 | bool allow_instances; |
| 366 | #ifdef CONFIG_TRACER_MAX_TRACE | 374 | #ifdef CONFIG_TRACER_MAX_TRACE |
| 367 | bool use_max_tr; | 375 | bool use_max_tr; |
| 368 | #endif | 376 | #endif |
| @@ -812,13 +820,36 @@ static inline int ftrace_trace_task(struct task_struct *task) | |||
| 812 | return test_tsk_trace_trace(task); | 820 | return test_tsk_trace_trace(task); |
| 813 | } | 821 | } |
| 814 | extern int ftrace_is_dead(void); | 822 | extern int ftrace_is_dead(void); |
| 823 | int ftrace_create_function_files(struct trace_array *tr, | ||
| 824 | struct dentry *parent); | ||
| 825 | void ftrace_destroy_function_files(struct trace_array *tr); | ||
| 815 | #else | 826 | #else |
| 816 | static inline int ftrace_trace_task(struct task_struct *task) | 827 | static inline int ftrace_trace_task(struct task_struct *task) |
| 817 | { | 828 | { |
| 818 | return 1; | 829 | return 1; |
| 819 | } | 830 | } |
| 820 | static inline int ftrace_is_dead(void) { return 0; } | 831 | static inline int ftrace_is_dead(void) { return 0; } |
| 821 | #endif | 832 | static inline int |
| 833 | ftrace_create_function_files(struct trace_array *tr, | ||
| 834 | struct dentry *parent) | ||
| 835 | { | ||
| 836 | return 0; | ||
| 837 | } | ||
| 838 | static inline void ftrace_destroy_function_files(struct trace_array *tr) { } | ||
| 839 | #endif /* CONFIG_FUNCTION_TRACER */ | ||
| 840 | |||
| 841 | #if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_DYNAMIC_FTRACE) | ||
| 842 | void ftrace_create_filter_files(struct ftrace_ops *ops, | ||
| 843 | struct dentry *parent); | ||
| 844 | void ftrace_destroy_filter_files(struct ftrace_ops *ops); | ||
| 845 | #else | ||
| 846 | /* | ||
| 847 | * The ops parameter passed in is usually undefined. | ||
| 848 | * This must be a macro. | ||
| 849 | */ | ||
| 850 | #define ftrace_create_filter_files(ops, parent) do { } while (0) | ||
| 851 | #define ftrace_destroy_filter_files(ops) do { } while (0) | ||
| 852 | #endif /* CONFIG_FUNCTION_TRACER && CONFIG_DYNAMIC_FTRACE */ | ||
| 822 | 853 | ||
| 823 | int ftrace_event_is_function(struct ftrace_event_call *call); | 854 | int ftrace_event_is_function(struct ftrace_event_call *call); |
| 824 | 855 | ||
| @@ -1249,7 +1280,7 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled); | |||
| 1249 | #undef FTRACE_ENTRY | 1280 | #undef FTRACE_ENTRY |
| 1250 | #define FTRACE_ENTRY(call, struct_name, id, tstruct, print, filter) \ | 1281 | #define FTRACE_ENTRY(call, struct_name, id, tstruct, print, filter) \ |
| 1251 | extern struct ftrace_event_call \ | 1282 | extern struct ftrace_event_call \ |
| 1252 | __attribute__((__aligned__(4))) event_##call; | 1283 | __aligned(4) event_##call; |
| 1253 | #undef FTRACE_ENTRY_DUP | 1284 | #undef FTRACE_ENTRY_DUP |
| 1254 | #define FTRACE_ENTRY_DUP(call, struct_name, id, tstruct, print, filter) \ | 1285 | #define FTRACE_ENTRY_DUP(call, struct_name, id, tstruct, print, filter) \ |
| 1255 | FTRACE_ENTRY(call, struct_name, id, PARAMS(tstruct), PARAMS(print), \ | 1286 | FTRACE_ENTRY(call, struct_name, id, PARAMS(tstruct), PARAMS(print), \ |
