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 /kernel/trace/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 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a44af05ae2d0..65b9e863056b 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1636,11 +1636,15 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, | |||
1636 | 1636 | ||
1637 | static atomic_t ftrace_graph_active; | 1637 | static atomic_t ftrace_graph_active; |
1638 | 1638 | ||
1639 | int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace) | ||
1640 | { | ||
1641 | return 0; | ||
1642 | } | ||
1643 | |||
1639 | /* The callbacks that hook a function */ | 1644 | /* The callbacks that hook a function */ |
1640 | trace_func_graph_ret_t ftrace_graph_return = | 1645 | trace_func_graph_ret_t ftrace_graph_return = |
1641 | (trace_func_graph_ret_t)ftrace_stub; | 1646 | (trace_func_graph_ret_t)ftrace_stub; |
1642 | trace_func_graph_ent_t ftrace_graph_entry = | 1647 | trace_func_graph_ent_t ftrace_graph_entry = ftrace_graph_entry_stub; |
1643 | (trace_func_graph_ent_t)ftrace_stub; | ||
1644 | 1648 | ||
1645 | /* Try to assign a return stack array on FTRACE_RETSTACK_ALLOC_SIZE tasks. */ | 1649 | /* Try to assign a return stack array on FTRACE_RETSTACK_ALLOC_SIZE tasks. */ |
1646 | static int alloc_retstack_tasklist(struct ftrace_ret_stack **ret_stack_list) | 1650 | static int alloc_retstack_tasklist(struct ftrace_ret_stack **ret_stack_list) |
@@ -1738,7 +1742,7 @@ void unregister_ftrace_graph(void) | |||
1738 | 1742 | ||
1739 | atomic_dec(&ftrace_graph_active); | 1743 | atomic_dec(&ftrace_graph_active); |
1740 | ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub; | 1744 | ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub; |
1741 | ftrace_graph_entry = (trace_func_graph_ent_t)ftrace_stub; | 1745 | ftrace_graph_entry = ftrace_graph_entry_stub; |
1742 | ftrace_shutdown(FTRACE_STOP_FUNC_RET); | 1746 | ftrace_shutdown(FTRACE_STOP_FUNC_RET); |
1743 | 1747 | ||
1744 | mutex_unlock(&ftrace_sysctl_lock); | 1748 | mutex_unlock(&ftrace_sysctl_lock); |