diff options
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 01e6adea07ec..41e46330d9be 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -82,9 +82,13 @@ void clear_ftrace_function(void); | |||
82 | extern void ftrace_stub(unsigned long a0, unsigned long a1); | 82 | extern void ftrace_stub(unsigned long a0, unsigned long a1); |
83 | 83 | ||
84 | #else /* !CONFIG_FUNCTION_TRACER */ | 84 | #else /* !CONFIG_FUNCTION_TRACER */ |
85 | # define register_ftrace_function(ops) do { } while (0) | 85 | /* |
86 | # define unregister_ftrace_function(ops) do { } while (0) | 86 | * (un)register_ftrace_function must be a macro since the ops parameter |
87 | # define clear_ftrace_function(ops) do { } while (0) | 87 | * must not be evaluated. |
88 | */ | ||
89 | #define register_ftrace_function(ops) ({ 0; }) | ||
90 | #define unregister_ftrace_function(ops) ({ 0; }) | ||
91 | static inline void clear_ftrace_function(void) { } | ||
88 | static inline void ftrace_kill(void) { } | 92 | static inline void ftrace_kill(void) { } |
89 | static inline void ftrace_stop(void) { } | 93 | static inline void ftrace_stop(void) { } |
90 | static inline void ftrace_start(void) { } | 94 | static inline void ftrace_start(void) { } |
@@ -237,11 +241,13 @@ extern int skip_trace(unsigned long ip); | |||
237 | extern void ftrace_disable_daemon(void); | 241 | extern void ftrace_disable_daemon(void); |
238 | extern void ftrace_enable_daemon(void); | 242 | extern void ftrace_enable_daemon(void); |
239 | #else | 243 | #else |
240 | # define skip_trace(ip) ({ 0; }) | 244 | static inline int skip_trace(unsigned long ip) { return 0; } |
241 | # define ftrace_force_update() ({ 0; }) | 245 | static inline int ftrace_force_update(void) { return 0; } |
242 | # define ftrace_set_filter(buf, len, reset) do { } while (0) | 246 | static inline void ftrace_set_filter(unsigned char *buf, int len, int reset) |
243 | # define ftrace_disable_daemon() do { } while (0) | 247 | { |
244 | # define ftrace_enable_daemon() do { } while (0) | 248 | } |
249 | static inline void ftrace_disable_daemon(void) { } | ||
250 | static inline void ftrace_enable_daemon(void) { } | ||
245 | static inline void ftrace_release_mod(struct module *mod) {} | 251 | static inline void ftrace_release_mod(struct module *mod) {} |
246 | static inline int register_ftrace_command(struct ftrace_func_command *cmd) | 252 | static inline int register_ftrace_command(struct ftrace_func_command *cmd) |
247 | { | 253 | { |
@@ -314,16 +320,16 @@ static inline void __ftrace_enabled_restore(int enabled) | |||
314 | extern void time_hardirqs_on(unsigned long a0, unsigned long a1); | 320 | extern void time_hardirqs_on(unsigned long a0, unsigned long a1); |
315 | extern void time_hardirqs_off(unsigned long a0, unsigned long a1); | 321 | extern void time_hardirqs_off(unsigned long a0, unsigned long a1); |
316 | #else | 322 | #else |
317 | # define time_hardirqs_on(a0, a1) do { } while (0) | 323 | static inline void time_hardirqs_on(unsigned long a0, unsigned long a1) { } |
318 | # define time_hardirqs_off(a0, a1) do { } while (0) | 324 | static inline void time_hardirqs_off(unsigned long a0, unsigned long a1) { } |
319 | #endif | 325 | #endif |
320 | 326 | ||
321 | #ifdef CONFIG_PREEMPT_TRACER | 327 | #ifdef CONFIG_PREEMPT_TRACER |
322 | extern void trace_preempt_on(unsigned long a0, unsigned long a1); | 328 | extern void trace_preempt_on(unsigned long a0, unsigned long a1); |
323 | extern void trace_preempt_off(unsigned long a0, unsigned long a1); | 329 | extern void trace_preempt_off(unsigned long a0, unsigned long a1); |
324 | #else | 330 | #else |
325 | # define trace_preempt_on(a0, a1) do { } while (0) | 331 | static inline void trace_preempt_on(unsigned long a0, unsigned long a1) { } |
326 | # define trace_preempt_off(a0, a1) do { } while (0) | 332 | static inline void trace_preempt_off(unsigned long a0, unsigned long a1) { } |
327 | #endif | 333 | #endif |
328 | 334 | ||
329 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 335 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
@@ -352,6 +358,10 @@ struct ftrace_graph_ret { | |||
352 | int depth; | 358 | int depth; |
353 | }; | 359 | }; |
354 | 360 | ||
361 | /* Type of the callback handlers for tracing function graph*/ | ||
362 | typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */ | ||
363 | typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */ | ||
364 | |||
355 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 365 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
356 | 366 | ||
357 | /* for init task */ | 367 | /* for init task */ |
@@ -400,10 +410,6 @@ extern char __irqentry_text_end[]; | |||
400 | 410 | ||
401 | #define FTRACE_RETFUNC_DEPTH 50 | 411 | #define FTRACE_RETFUNC_DEPTH 50 |
402 | #define FTRACE_RETSTACK_ALLOC_SIZE 32 | 412 | #define FTRACE_RETSTACK_ALLOC_SIZE 32 |
403 | /* Type of the callback handlers for tracing function graph*/ | ||
404 | typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */ | ||
405 | typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */ | ||
406 | |||
407 | extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, | 413 | extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, |
408 | trace_func_graph_ent_t entryfunc); | 414 | trace_func_graph_ent_t entryfunc); |
409 | 415 | ||
@@ -441,6 +447,13 @@ static inline void unpause_graph_tracing(void) | |||
441 | static inline void ftrace_graph_init_task(struct task_struct *t) { } | 447 | static inline void ftrace_graph_init_task(struct task_struct *t) { } |
442 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } | 448 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } |
443 | 449 | ||
450 | static inline int register_ftrace_graph(trace_func_graph_ret_t retfunc, | ||
451 | trace_func_graph_ent_t entryfunc) | ||
452 | { | ||
453 | return -1; | ||
454 | } | ||
455 | static inline void unregister_ftrace_graph(void) { } | ||
456 | |||
444 | static inline int task_curr_ret_stack(struct task_struct *tsk) | 457 | static inline int task_curr_ret_stack(struct task_struct *tsk) |
445 | { | 458 | { |
446 | return -1; | 459 | return -1; |
@@ -492,7 +505,9 @@ static inline int test_tsk_trace_graph(struct task_struct *tsk) | |||
492 | return tsk->trace & TSK_TRACE_FL_GRAPH; | 505 | return tsk->trace & TSK_TRACE_FL_GRAPH; |
493 | } | 506 | } |
494 | 507 | ||
495 | extern int ftrace_dump_on_oops; | 508 | enum ftrace_dump_mode; |
509 | |||
510 | extern enum ftrace_dump_mode ftrace_dump_on_oops; | ||
496 | 511 | ||
497 | #ifdef CONFIG_PREEMPT | 512 | #ifdef CONFIG_PREEMPT |
498 | #define INIT_TRACE_RECURSION .trace_recursion = 0, | 513 | #define INIT_TRACE_RECURSION .trace_recursion = 0, |
@@ -504,18 +519,6 @@ extern int ftrace_dump_on_oops; | |||
504 | #define INIT_TRACE_RECURSION | 519 | #define INIT_TRACE_RECURSION |
505 | #endif | 520 | #endif |
506 | 521 | ||
507 | #ifdef CONFIG_HW_BRANCH_TRACER | ||
508 | |||
509 | void trace_hw_branch(u64 from, u64 to); | ||
510 | void trace_hw_branch_oops(void); | ||
511 | |||
512 | #else /* CONFIG_HW_BRANCH_TRACER */ | ||
513 | |||
514 | static inline void trace_hw_branch(u64 from, u64 to) {} | ||
515 | static inline void trace_hw_branch_oops(void) {} | ||
516 | |||
517 | #endif /* CONFIG_HW_BRANCH_TRACER */ | ||
518 | |||
519 | #ifdef CONFIG_FTRACE_SYSCALLS | 522 | #ifdef CONFIG_FTRACE_SYSCALLS |
520 | 523 | ||
521 | unsigned long arch_syscall_addr(int nr); | 524 | unsigned long arch_syscall_addr(int nr); |