mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tom Zanussi <zanussi@kernel.org>
Cc: axelrasmussen@google.com, mhiramat@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/3] tracing: Add dynamic strings for synthetic events
Date: Fri, 2 Oct 2020 20:55:10 -0400	[thread overview]
Message-ID: <20201002205510.229a25bc@oasis.local.home> (raw)
In-Reply-To: <cover.1601588066.git.zanussi@kernel.org>

On Thu,  1 Oct 2020 16:46:43 -0500
Tom Zanussi <zanussi@kernel.org> wrote:

> Hi,
> 
> This is v3 of the dynamic string support for synthetic events.
> 
> No code changes since v2, just added Fixes: tag for 'tracing: Fix
> parse_synth_field() error handling' as suggested by Masami along with
> his Reviewed-by, and Axel's Tested-bys.
> 

I added the following to make it work with trace-cmd. Dynamic strings
must have __get_str() for events in the print_fmt otherwise it can't be
parsed correctly.

-- Steve

diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
index 4b3ec570147a..24bc6d61aa40 100644
--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -489,8 +489,13 @@ static int __set_synth_event_print_fmt(struct synth_event *event,
 	pos += snprintf(buf + pos, LEN_OR_ZERO, "\"");
 
 	for (i = 0; i < event->n_fields; i++) {
-		pos += snprintf(buf + pos, LEN_OR_ZERO,
-				", REC->%s", event->fields[i]->name);
+		if (event->fields[i]->is_dynamic &&
+		    event->fields[i]->is_dynamic)
+			pos += snprintf(buf + pos, LEN_OR_ZERO,
+				", __get_str(%s)", event->fields[i]->name);
+		else
+			pos += snprintf(buf + pos, LEN_OR_ZERO,
+					", REC->%s", event->fields[i]->name);
 	}
 
 #undef LEN_OR_ZERO

  parent reply	other threads:[~2020-10-03  0:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 21:46 Tom Zanussi
2020-10-01 21:46 ` [PATCH v3 1/3] tracing: Change STR_VAR_MAX_LEN Tom Zanussi
2020-10-02 19:44   ` Steven Rostedt
2020-10-02 22:04     ` Tom Zanussi
2020-10-01 21:46 ` [PATCH v3 2/3] tracing: Fix parse_synth_field() error handling Tom Zanussi
2020-10-01 21:46 ` [PATCH v3 3/3] tracing: Add support for dynamic strings to synthetic events Tom Zanussi
2020-10-03  0:55 ` Steven Rostedt [this message]
2020-10-03  1:00 ` [PATCH v3 0/3] tracing: Add dynamic strings for " 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=20201002205510.229a25bc@oasis.local.home \
    --to=rostedt@goodmis.org \
    --cc=axelrasmussen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@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

all inboxes | Powered by JetHome®