diff options
Diffstat (limited to 'kernel/trace/trace.h')
| -rw-r--r-- | kernel/trace/trace.h | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 02b592f2d4b7..ffc314b7e92b 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
| @@ -210,6 +210,11 @@ struct trace_array { | |||
| 210 | struct list_head events; | 210 | struct list_head events; |
| 211 | cpumask_var_t tracing_cpumask; /* only trace on set CPUs */ | 211 | cpumask_var_t tracing_cpumask; /* only trace on set CPUs */ |
| 212 | int ref; | 212 | int ref; |
| 213 | #ifdef CONFIG_FUNCTION_TRACER | ||
| 214 | struct ftrace_ops *ops; | ||
| 215 | /* function tracing enabled */ | ||
| 216 | int function_enabled; | ||
| 217 | #endif | ||
| 213 | }; | 218 | }; |
| 214 | 219 | ||
| 215 | enum { | 220 | enum { |
| @@ -355,14 +360,16 @@ struct tracer { | |||
| 355 | void (*print_header)(struct seq_file *m); | 360 | void (*print_header)(struct seq_file *m); |
| 356 | enum print_line_t (*print_line)(struct trace_iterator *iter); | 361 | enum print_line_t (*print_line)(struct trace_iterator *iter); |
| 357 | /* If you handled the flag setting, return 0 */ | 362 | /* If you handled the flag setting, return 0 */ |
| 358 | int (*set_flag)(u32 old_flags, u32 bit, int set); | 363 | int (*set_flag)(struct trace_array *tr, |
| 364 | u32 old_flags, u32 bit, int set); | ||
| 359 | /* Return 0 if OK with change, else return non-zero */ | 365 | /* Return 0 if OK with change, else return non-zero */ |
| 360 | int (*flag_changed)(struct tracer *tracer, | 366 | int (*flag_changed)(struct trace_array *tr, |
| 361 | u32 mask, int set); | 367 | u32 mask, int set); |
| 362 | struct tracer *next; | 368 | struct tracer *next; |
| 363 | struct tracer_flags *flags; | 369 | struct tracer_flags *flags; |
| 370 | int enabled; | ||
| 364 | bool print_max; | 371 | bool print_max; |
| 365 | bool enabled; | 372 | bool allow_instances; |
| 366 | #ifdef CONFIG_TRACER_MAX_TRACE | 373 | #ifdef CONFIG_TRACER_MAX_TRACE |
| 367 | bool use_max_tr; | 374 | bool use_max_tr; |
| 368 | #endif | 375 | #endif |
| @@ -812,13 +819,36 @@ static inline int ftrace_trace_task(struct task_struct *task) | |||
| 812 | return test_tsk_trace_trace(task); | 819 | return test_tsk_trace_trace(task); |
| 813 | } | 820 | } |
| 814 | extern int ftrace_is_dead(void); | 821 | extern int ftrace_is_dead(void); |
| 822 | int ftrace_create_function_files(struct trace_array *tr, | ||
| 823 | struct dentry *parent); | ||
| 824 | void ftrace_destroy_function_files(struct trace_array *tr); | ||
| 815 | #else | 825 | #else |
| 816 | static inline int ftrace_trace_task(struct task_struct *task) | 826 | static inline int ftrace_trace_task(struct task_struct *task) |
| 817 | { | 827 | { |
| 818 | return 1; | 828 | return 1; |
| 819 | } | 829 | } |
| 820 | static inline int ftrace_is_dead(void) { return 0; } | 830 | static inline int ftrace_is_dead(void) { return 0; } |
| 821 | #endif | 831 | static inline int |
| 832 | ftrace_create_function_files(struct trace_array *tr, | ||
| 833 | struct dentry *parent) | ||
| 834 | { | ||
| 835 | return 0; | ||
| 836 | } | ||
| 837 | static inline void ftrace_destroy_function_files(struct trace_array *tr) { } | ||
| 838 | #endif /* CONFIG_FUNCTION_TRACER */ | ||
| 839 | |||
| 840 | #if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_DYNAMIC_FTRACE) | ||
| 841 | void ftrace_create_filter_files(struct ftrace_ops *ops, | ||
| 842 | struct dentry *parent); | ||
| 843 | void ftrace_destroy_filter_files(struct ftrace_ops *ops); | ||
| 844 | #else | ||
| 845 | /* | ||
| 846 | * The ops parameter passed in is usually undefined. | ||
| 847 | * This must be a macro. | ||
| 848 | */ | ||
| 849 | #define ftrace_create_filter_files(ops, parent) do { } while (0) | ||
| 850 | #define ftrace_destroy_filter_files(ops) do { } while (0) | ||
| 851 | #endif /* CONFIG_FUNCTION_TRACER && CONFIG_DYNAMIC_FTRACE */ | ||
| 822 | 852 | ||
| 823 | int ftrace_event_is_function(struct ftrace_event_call *call); | 853 | int ftrace_event_is_function(struct ftrace_event_call *call); |
| 824 | 854 | ||
