ftrace: Fix accounting error in updating funcgraph-args
Steven Rostedt
maintainerLinus,
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(+)
---------------------------
kernel/trace/trace_functions_graph.c +6 -0
@@ -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
The pull request you sent on Wed, 18 Jun 2025 11:49:07 -0400:
The pull request you sent on Wed, 18 Jun 2025 11:49:07 -0400:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.gitftrace-v6.16-rc2
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/5da3ff1fd0fdce7b5d9508c62403c04a8c96a1e5
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html