[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250618114907.23b824df@gandalf.local.home>
Date: Wed, 18 Jun 2025 11:49:07 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Mark Rutland <mark.rutland@....com>, Changbin Du <changbin.du@...wei.com>
Subject: [GIT PULL] ftrace: Fix accounting error in updating funcgraph-args
Linus,
ftrace fix for 6.16:
- 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.
Please pull the latest ftrace-v6.16-rc2 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
ftrace-v6.16-rc2
Tag SHA1: 858ffefa15e822fdffe18bdfc34bf634ea8afd2a
Head SHA1: 327e28664307d49ce3fa71ba30dcc0007c270974
Steven Rostedt (1):
fgraph: Do not enable function_graph tracer when setting funcgraph-args
----
kernel/trace/trace_functions_graph.c | 6 ++++++
1 file changed, 6 insertions(+)
---------------------------
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 9234e2c39abf..14d74a7491b8 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -455,10 +455,16 @@ static int graph_trace_init(struct trace_array *tr)
return 0;
}
+static struct tracer graph_trace;
+
static int ftrace_graph_trace_args(struct trace_array *tr, int set)
{
trace_func_graph_ent_t entry;
+ /* Do nothing if the current tracer is not this tracer */
+ if (tr->current_trace != &graph_trace)
+ return 0;
+
if (set)
entry = trace_graph_entry_args;
else
Powered by blists - more mailing lists