Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Douglas Raillard <douglas.raillard@arm.com>
To: Sasha Levin <sashal@kernel.org>, stable@vger.kernel.org
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Tom Zanussi <zanussi@kernel.org>,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Subject: Re: [PATCH 6.1.y] tracing: Do not add length to print format in synthetic events
Date: Tue, 9 Sep 2025 13:04:33 +0100	[thread overview]
Message-ID: <c49ae320-b73e-42b3-b41a-4f71560a6431@arm.com> (raw)
In-Reply-To: <20250907222532.932220-1-sashal@kernel.org>

Hi Sasha,

On 07-09-2025 23:25, Sasha Levin wrote:
>   1 file changed, 2 deletions(-)
> 
> diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
> index 385e9fbbfbe7c..c2817d0c05b69 100644
> --- a/kernel/trace/trace_events_synth.c
> +++ b/kernel/trace/trace_events_synth.c
> @@ -383,13 +383,11 @@ static enum print_line_t print_synth_event(struct trace_iterator *iter,
>   				str_field = (char *)entry + data_offset;
>   
>   				trace_seq_printf(s, print_fmt, se->fields[i]->name,
> -						 STR_VAR_LEN_MAX,
>   						 str_field,
>   						 i == se->n_fields - 1 ? "" : " ");
>   				n_u64++;
>   			} else {
>   				trace_seq_printf(s, print_fmt, se->fields[i]->name,
> -						 STR_VAR_LEN_MAX,
>   						 (char *)&entry->fields[n_u64],
>   						 i == se->n_fields - 1 ? "" : " ");
>   				n_u64 += STR_VAR_LEN_MAX / sizeof(u64);

This looks consistent to me with that patch:
[PATCH v2] tracing: Fix synth event printk format for str fields

diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
index e3f7d09e5512..f71e49cd35b0 100644
--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -305,7 +305,7 @@ static const char *synth_field_fmt(char *type)
         else if (strcmp(type, "gfp_t") == 0)
                 fmt = "%x";
         else if (synth_field_is_string(type))
-               fmt = "%.*s";
+               fmt = "%s";
         else if (synth_field_is_stack(type))
                 fmt = "%s";
  
I only tested the trace.dat route when writing it, thanks for catching this case.


Cheers,

Douglas


      reply	other threads:[~2025-09-09 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17 12:26 FAILED: patch "[PATCH] tracing: Do not add length to print format in synthetic" failed to apply to 6.1-stable tree gregkh
2025-09-07 22:25 ` [PATCH 6.1.y] tracing: Do not add length to print format in synthetic events Sasha Levin
2025-09-09 12:04   ` Douglas Raillard [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=c49ae320-b73e-42b3-b41a-4f71560a6431@arm.com \
    --to=douglas.raillard@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=zanussi@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