Skip to content

Commit 5da3ff1

Browse files
committed
Merge tag 'ftrace-v6.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull ftrace fix from Steven Rostedt: - Do not blindly enable function_graph tracer when updating funcgraph-args When the option to trace function arguments in the function graph trace is updated, it requires the function graph tracer to switch its callback routine. It disables function graph tracing, updates the callback and then re-enables function graph tracing. The issue is that it doesn't check if function graph tracing is currently enabled or not. If it is not enabled, it will try to disable it and re-enable it (which will actually enable it even though it is not the current tracer). This causes an issue in the accounting and will trigger a WARN_ON() if the function tracer is enabled after that. * tag 'ftrace-v6.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: fgraph: Do not enable function_graph tracer when setting funcgraph-args
2 parents 5a3b583 + 327e286 commit 5da3ff1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kernel/trace/trace_functions_graph.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,16 @@ static int graph_trace_init(struct trace_array *tr)
455455
return 0;
456456
}
457457

458+
static struct tracer graph_trace;
459+
458460
static int ftrace_graph_trace_args(struct trace_array *tr, int set)
459461
{
460462
trace_func_graph_ent_t entry;
461463

464+
/* Do nothing if the current tracer is not this tracer */
465+
if (tr->current_trace != &graph_trace)
466+
return 0;
467+
462468
if (set)
463469
entry = trace_graph_entry_args;
464470
else

0 commit comments

Comments
 (0)