public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Douglas Raillard <douglas.raillard@arm.com>
Subject: [for-next][PATCH 10/10] tracing: Fix synth event printk format for str fields
Date: Sun, 23 Mar 2025 08:29:43 -0400	[thread overview]
Message-ID: <20250323122950.727283891@goodmis.org> (raw)
In-Reply-To: 20250323122933.407277911@goodmis.org

From: Douglas Raillard <douglas.raillard@arm.com>

The printk format for synth event uses "%.*s" to print string fields,
but then only passes the pointer part as var arg.

Add the missing precision var arg.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250318180939.227696-1-douglas.raillard@arm.com
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/trace_events_synth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
index 463b0073629a..d91205bc9f61 100644
--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -620,7 +620,8 @@ static int __set_synth_event_print_fmt(struct synth_event *event,
 		if (event->fields[i]->is_string &&
 		    event->fields[i]->is_dynamic)
 			pos += snprintf(buf + pos, LEN_OR_ZERO,
-				", __get_str(%s)", event->fields[i]->name);
+				", (int)__get_dynamic_array_len(%s), __get_str(%s)",
+				event->fields[i]->name, event->fields[i]->name);
 		else if (event->fields[i]->is_stack)
 			pos += snprintf(buf + pos, LEN_OR_ZERO,
 				", __get_stacktrace(%s)", event->fields[i]->name);
-- 
2.47.2



      parent reply	other threads:[~2025-03-23 12:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-23 12:29 [for-next][PATCH 00/10] tracing: Updates for 6.15 Steven Rostedt
2025-03-23 12:29 ` [for-next][PATCH 01/10] scripts/tracing: Remove scripts/tracing/draw_functrace.py Steven Rostedt
2025-03-23 12:29 ` [for-next][PATCH 02/10] tracing: Constify struct event_trigger_ops Steven Rostedt
2025-03-23 12:29 ` [for-next][PATCH 03/10] tracepoint: Print the function symbol when tracepoint_debug is set Steven Rostedt
2025-03-23 12:29 ` [for-next][PATCH 04/10] tracing: gfp: vsprintf: Do not print "none" when using %pGg printf format Steven Rostedt
2025-03-23 12:29 ` [for-next][PATCH 05/10] tracing: Use hashtable.h for event_hash Steven Rostedt
2025-03-23 12:39   ` Steven Rostedt
2025-03-23 13:28     ` [PATCH] " Sasha Levin
2025-03-23 12:29 ` [for-next][PATCH 06/10] tracing: Align synth event print fmt Steven Rostedt
2025-03-23 12:29 ` [for-next][PATCH 07/10] tracing/osnoise: Fix possible recursive locking for cpus_read_lock() Steven Rostedt
2025-03-23 12:29 ` [for-next][PATCH 08/10] tracing: fix return value in __ftrace_event_enable_disable for TRACE_REG_UNREGISTER Steven Rostedt
2025-03-23 12:29 ` [for-next][PATCH 09/10] tracing: Ensure module defining synth event cannot be unloaded while tracing Steven Rostedt
2025-03-23 12:29 ` Steven Rostedt [this message]

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=20250323122950.727283891@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=douglas.raillard@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.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