aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-24 00:18:31 -0400
committerSteven Rostedt <srostedt@redhat.com>2009-03-24 09:32:52 -0400
commit05ce5818adee8f8efd0a5ca0d900a6789012516b (patch)
tree81c90288dd1da4291b5e3ee154756b2d7745c248
parent5d1a03dc541dc6672e60e57249ed22f40654ca47 (diff)
function-graph: prevent more than one tracer registering
Impact: prevent crash due to multiple function graph tracers The function graph tracer can currently only handle a single tracer being registered. If another tracer registers with the function graph tracer it can crash the system. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
-rw-r--r--kernel/trace/ftrace.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 7847806eefef..c81a759fbf76 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2643,6 +2643,12 @@ int register_ftrace_graph(trace_func_graph_ret_t retfunc,
2643 2643
2644 mutex_lock(&ftrace_lock); 2644 mutex_lock(&ftrace_lock);
2645 2645
2646 /* we currently allow only one tracer registered at a time */
2647 if (atomic_read(&ftrace_graph_active)) {
2648 ret = -EBUSY;
2649 goto out;
2650 }
2651
2646 ftrace_suspend_notifier.notifier_call = ftrace_suspend_notifier_call; 2652 ftrace_suspend_notifier.notifier_call = ftrace_suspend_notifier_call;
2647 register_pm_notifier(&ftrace_suspend_notifier); 2653 register_pm_notifier(&ftrace_suspend_notifier);
2648 2654