All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@kernel.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>,
	stable@vger.kernel.org,
	Douglas Raillard <douglas.raillard@arm.com>
Subject: [for-linus][PATCH 02/15] tracing: Fix fixed array of synthetic event
Date: Fri, 05 Dec 2025 20:06:35 -0500	[thread overview]
Message-ID: <20251206010700.980966840@kernel.org> (raw)
In-Reply-To: 20251206010633.884804695@kernel.org

From: Steven Rostedt <rostedt@goodmis.org>

The commit 4d38328eb442d ("tracing: Fix synth event printk format for str
fields") replaced "%.*s" with "%s" but missed removing the number size of
the dynamic and static strings. The commit e1a453a57bc7 ("tracing: Do not
add length to print format in synthetic events") fixed the dynamic part
but did not fix the static part. That is, with the commands:

  # echo 's:wake_lat char[] wakee; u64 delta;' >> /sys/kernel/tracing/dynamic_events
  # echo 'hist:keys=pid:ts=common_timestamp.usecs if !(common_flags & 0x18)' > /sys/kernel/tracing/events/sched/sched_waking/trigger
  # echo 'hist:keys=next_pid:delta=common_timestamp.usecs-$ts:onmatch(sched.sched_waking).trace(wake_lat,next_comm,$delta)' > /sys/kernel/tracing/events/sched/sched_switch/trigger

That caused the output of:

          <idle>-0       [001] d..5.   193.428167: wake_lat: wakee=(efault)sshd-sessiondelta=155
    sshd-session-879     [001] d..5.   193.811080: wake_lat: wakee=(efault)kworker/u34:5delta=58
          <idle>-0       [002] d..5.   193.811198: wake_lat: wakee=(efault)bashdelta=91

The commit e1a453a57bc7 fixed the part where the synthetic event had
"char[] wakee". But if one were to replace that with a static size string:

  # echo 's:wake_lat char[16] wakee; u64 delta;' >> /sys/kernel/tracing/dynamic_events

Where "wakee" is defined as "char[16]" and not "char[]" making it a static
size, the code triggered the "(efaul)" again.

Remove the added STR_VAR_LEN_MAX size as the string is still going to be
nul terminated.

Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Douglas Raillard <douglas.raillard@arm.com>
Link: https://patch.msgid.link/20251204151935.5fa30355@gandalf.local.home
Fixes: e1a453a57bc7 ("tracing: Do not add length to print format in synthetic events")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/trace_events_synth.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
index 2f19bbe73d27..4554c458b78c 100644
--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -375,7 +375,6 @@ static enum print_line_t print_synth_event(struct trace_iterator *iter,
 				n_u64++;
 			} else {
 				trace_seq_printf(s, print_fmt, se->fields[i]->name,
-						 STR_VAR_LEN_MAX,
 						 (char *)&entry->fields[n_u64].as_u64,
 						 i == se->n_fields - 1 ? "" : " ");
 				n_u64 += STR_VAR_LEN_MAX / sizeof(u64);
-- 
2.51.0



  parent reply	other threads:[~2025-12-06  1:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-06  1:06 [for-linus][PATCH 00/15] tracing: Fixes for v6.19 Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 01/15] tracing: Fix enabling of tracing on file release Steven Rostedt
2025-12-06  1:06 ` Steven Rostedt [this message]
2025-12-06  1:06 ` [for-linus][PATCH 03/15] tracing: Fix typo in fpgraph.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 04/15] tracing: Fix typo in fprobe.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 05/15] tracing: Fix multiple typos in ring_buffer.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 06/15] tracing: Fix typo in ring_buffer_benchmark.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 07/15] tracing: Fix multiple typos in trace.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 08/15] tracing: Fix multiple typos in trace_events.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 09/15] tracing: Fix typo in trace_events_filter.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 10/15] tracing: Fix typo in trace_events_hist.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 11/15] tracing: Fix typo in trace_events_trigger.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 12/15] tracing: Fix multiple typos in trace_events_user.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 13/15] tracing: Fix multiple typos in trace_osnoise.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 14/15] tracing: Fix typo in trace_probe.c Steven Rostedt
2025-12-06  1:06 ` [for-linus][PATCH 15/15] tracing: Fix typo in trace_seq.c Steven Rostedt

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=20251206010700.980966840@kernel.org \
    --to=rostedt@kernel.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 \
    --cc=stable@vger.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 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.