diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-01-15 19:12:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-16 06:15:32 -0500 |
commit | 5361499101306cfb776c3cfa0f69d0479bc63868 (patch) | |
tree | 1acf51a942abe6582e08ed86b4bbb98f9c095c89 /kernel/trace/trace.h | |
parent | 6c1a99afbda99cd8d8c69d756387041567a13d87 (diff) |
ftrace: add stack trace to function tracer
Impact: new feature to stack trace any function
Chris Mason asked about being able to pick and choose a function
and get a stack trace from it. This feature enables his request.
# echo io_schedule > /debug/tracing/set_ftrace_filter
# echo function > /debug/tracing/current_tracer
# echo func_stack_trace > /debug/tracing/trace_options
Produces the following in /debug/tracing/trace:
kjournald-702 [001] 135.673060: io_schedule <-sync_buffer
kjournald-702 [002] 135.673671:
<= sync_buffer
<= __wait_on_bit
<= out_of_line_wait_on_bit
<= __wait_on_buffer
<= sync_dirty_buffer
<= journal_commit_transaction
<= kjournald
Note, be careful about turning this on without filtering the functions.
You may find that you have a 10 second lag between typing and seeing
what you typed. This is why the stack trace for the function tracer
does not use the same stack_trace flag as the other tracers use.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 79c872100dd5..bf39a369e4b3 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -457,6 +457,11 @@ void update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu); | |||
457 | void update_max_tr_single(struct trace_array *tr, | 457 | void update_max_tr_single(struct trace_array *tr, |
458 | struct task_struct *tsk, int cpu); | 458 | struct task_struct *tsk, int cpu); |
459 | 459 | ||
460 | void __trace_stack(struct trace_array *tr, | ||
461 | struct trace_array_cpu *data, | ||
462 | unsigned long flags, | ||
463 | int skip, int pc); | ||
464 | |||
460 | extern cycle_t ftrace_now(int cpu); | 465 | extern cycle_t ftrace_now(int cpu); |
461 | 466 | ||
462 | #ifdef CONFIG_FUNCTION_TRACER | 467 | #ifdef CONFIG_FUNCTION_TRACER |
@@ -467,6 +472,8 @@ void tracing_stop_function_trace(void); | |||
467 | # define tracing_stop_function_trace() do { } while (0) | 472 | # define tracing_stop_function_trace() do { } while (0) |
468 | #endif | 473 | #endif |
469 | 474 | ||
475 | extern int ftrace_function_enabled; | ||
476 | |||
470 | #ifdef CONFIG_CONTEXT_SWITCH_TRACER | 477 | #ifdef CONFIG_CONTEXT_SWITCH_TRACER |
471 | typedef void | 478 | typedef void |
472 | (*tracer_switch_func_t)(void *private, | 479 | (*tracer_switch_func_t)(void *private, |