diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-12-02 23:50:05 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-03 02:56:26 -0500 |
commit | e49dc19c6a19ea112fcb94b7c62ec62cdd5c08aa (patch) | |
tree | 851dcdfe321e16a327d656ecd7040ef6e8590bec /arch/x86/kernel/ftrace.c | |
parent | 7ee991fbc6f947e9b04f29c9c6c1d057d0671a16 (diff) |
ftrace: function graph return for function entry
Impact: feature, let entry function decide to trace or not
This patch lets the graph tracer entry function decide if the tracing
should be done at the end as well. This requires all function graph
entry functions return 1 if it should trace, or 0 if the return should
not be traced.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/ftrace.c')
-rw-r--r-- | arch/x86/kernel/ftrace.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index adba8e9a427c..d278ad2ebda2 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -425,6 +425,7 @@ static void pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret) | |||
425 | trace->calltime = current->ret_stack[index].calltime; | 425 | trace->calltime = current->ret_stack[index].calltime; |
426 | trace->overrun = atomic_read(¤t->trace_overrun); | 426 | trace->overrun = atomic_read(¤t->trace_overrun); |
427 | trace->depth = index; | 427 | trace->depth = index; |
428 | barrier(); | ||
428 | current->curr_ret_stack--; | 429 | current->curr_ret_stack--; |
429 | } | 430 | } |
430 | 431 | ||
@@ -506,7 +507,11 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | |||
506 | } | 507 | } |
507 | 508 | ||
508 | trace.func = self_addr; | 509 | trace.func = self_addr; |
509 | ftrace_graph_entry(&trace); | ||
510 | 510 | ||
511 | /* Only trace if the calling function expects to */ | ||
512 | if (!ftrace_graph_entry(&trace)) { | ||
513 | current->curr_ret_stack--; | ||
514 | *parent = old; | ||
515 | } | ||
511 | } | 516 | } |
512 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 517 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |