All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Carlier <devnexen@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Carlier <devnexen@gmail.com>
Subject: [PATCH] tracing: Report TP_printk double dereference with pr_warn()
Date: Thu,  6 Aug 2026 06:07:16 +0100	[thread overview]
Message-ID: <20260806050716.16612-1-devnexen@gmail.com> (raw)

test_double_dereference() uses WARN_ONCE(), which is per-call-site. Only
the first offending event in the kernel is ever reported, and the tree
still has six: ice_{rx,tx}_dim_template, two hfi1 txq events, mtu3_ep and
edma_log_io. Whichever registers first hides the rest, and it taints the
kernel for what is a source-level mistake.

Use pr_warn() instead, matching the "TRACE EVENT ERROR:" report that
handle_dereference_arg() already emits for the same class of problem.
All offenders are now listed on one boot.

Fixes: b5cc230af5e5 ("tracing: Warn when an event dereferences a pointer in TP_printk()")
Signed-off-by: David Carlier <devnexen@gmail.com>
---
 kernel/trace/trace_events.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index a8590d2394e3..53f32752edc0 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -415,8 +415,8 @@ static void test_double_dereference(const char *str, int len,
 		ptr += 5;
 		for (; ptr < end; ptr++) {
 			if (ptr[0] == '-' && ptr[1] == '>') {
-				WARN_ONCE(1, "Event %s has double dereference in TP_printk: %.*s\n",
-					  trace_event_name(call), len, str);
+				pr_warn("TRACE EVENT ERROR: Event %s has double dereference in TP_printk: %.*s\n",
+					trace_event_name(call), len, str);
 				return;
 			}
 			if (!isalnum(*ptr) && *ptr != '_')
-- 
2.55.0


             reply	other threads:[~2026-08-06  5:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06  5:07 David Carlier [this message]
2026-08-06 21:41 ` [PATCH] tracing: Report TP_printk double dereference with pr_warn() Steven Rostedt
2026-08-06 21:52   ` [PATCH v2] tracing: Report every TP_printk double dereference David Carlier

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=20260806050716.16612-1-devnexen@gmail.com \
    --to=devnexen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.