Skip to content

Commit

Permalink
function-graph: prevent more than one tracer registering
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt committed Mar 24, 2009
1 parent 5d1a03d commit 05ce581
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,12 @@ int register_ftrace_graph(trace_func_graph_ret_t retfunc,

mutex_lock(&ftrace_lock);

/* we currently allow only one tracer registered at a time */
if (atomic_read(&ftrace_graph_active)) {
ret = -EBUSY;
goto out;
}

ftrace_suspend_notifier.notifier_call = ftrace_suspend_notifier_call;
register_pm_notifier(&ftrace_suspend_notifier);

Expand Down

0 comments on commit 05ce581

Please sign in to comment.