linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] ftrace: Fix accounting error in updating funcgraph-args
@ 2025-06-18 15:49 Steven Rostedt
  2025-06-18 18:08 ` pr-tracker-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2025-06-18 15:49 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: LKML, Masami Hiramatsu, Mathieu Desnoyers, Mark Rutland,
	Changbin Du



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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [GIT PULL] ftrace: Fix accounting error in updating funcgraph-args
  2025-06-18 15:49 [GIT PULL] ftrace: Fix accounting error in updating funcgraph-args Steven Rostedt
@ 2025-06-18 18:08 ` pr-tracker-bot
  0 siblings, 0 replies; 2+ messages in thread
From: pr-tracker-bot @ 2025-06-18 18:08 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Linus Torvalds, LKML, Masami Hiramatsu, Mathieu Desnoyers,
	Mark Rutland, Changbin Du

The pull request you sent on Wed, 18 Jun 2025 11:49:07 -0400:

> git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git ftrace-v6.16-rc2

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/5da3ff1fd0fdce7b5d9508c62403c04a8c96a1e5

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-18 18:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 15:49 [GIT PULL] ftrace: Fix accounting error in updating funcgraph-args Steven Rostedt
2025-06-18 18:08 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).