mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Changbin Du <changbin.du@huawei.com>
Subject: [GIT PULL] ftrace: Fix accounting error in updating funcgraph-args
Date: Wed, 18 Jun 2025 11:49:07 -0400	[thread overview]
Message-ID: <20250618114907.23b824df@gandalf.local.home> (raw)



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

             reply	other threads:[~2025-06-18 15:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18 15:49 Steven Rostedt [this message]
2025-06-18 18:08 ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250618114907.23b824df@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=changbin.du@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®