]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - kernel/trace/trace.c
ftrace: add stack trace to function tracer
authorSteven Rostedt <srostedt@redhat.com>
Fri, 16 Jan 2009 00:12:40 +0000 (19:12 -0500)
committerIngo Molnar <mingo@elte.hu>
Fri, 16 Jan 2009 11:15:32 +0000 (12:15 +0100)
commit5361499101306cfb776c3cfa0f69d0479bc63868
tree1acf51a942abe6582e08ed86b4bbb98f9c095c89
parent6c1a99afbda99cd8d8c69d756387041567a13d87
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>
kernel/trace/trace.c
kernel/trace/trace.h
kernel/trace/trace_functions.c