linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Subject: [PATCH 2/4] libtracefs: Fix tracefs_synth_echo_cmd()
Date: Mon, 31 Jan 2022 11:36:40 -0500	[thread overview]
Message-ID: <20220131163642.2754485-3-rostedt@goodmis.org> (raw)
In-Reply-To: <20220131163642.2754485-1-rostedt@goodmis.org>

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The update to use dynamic_events instead of synthetic_events for echoing
the synthetic event missed out on adding the colon, and made the output
incorrect for the new format.

Fixes: d7c5dbb7a231e ("libtracefs: Use the internal dynamic events API when creating synthetic events")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 src/tracefs-hist.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/tracefs-hist.c b/src/tracefs-hist.c
index 8d99492c84a7..622fe5c98c41 100644
--- a/src/tracefs-hist.c
+++ b/src/tracefs-hist.c
@@ -2155,8 +2155,10 @@ int tracefs_synth_echo_cmd(struct trace_seq *seq,
 	if (!path)
 		goto out_free;
 
-	trace_seq_printf(seq, "echo '%s%s %s' > %s/%s\n",
-			 synth->dyn_event->prefix, synth->dyn_event->event,
+	trace_seq_printf(seq, "echo '%s%s%s %s' > %s/%s\n",
+			 synth->dyn_event->prefix,
+			 strlen(synth->dyn_event->prefix) ? ":" : "",
+			 synth->dyn_event->event,
 			 synth->dyn_event->format, path, synth->dyn_event->trace_file);
 
 	tracefs_put_tracing_file(path);
-- 
2.33.0


  parent reply	other threads:[~2022-01-31 16:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31 16:36 [PATCH 0/4] libtracefs: synthetic event fixes Steven Rostedt
2022-01-31 16:36 ` [PATCH 1/4] libtracefs: Initialized func_list in tracefs_filter_functions() Steven Rostedt
2022-01-31 16:36 ` Steven Rostedt [this message]
2022-01-31 16:36 ` [PATCH 3/4] libtracefs: Check README to know if we should do old onmatch format Steven Rostedt
2022-01-31 16:36 ` [PATCH 4/4] libtracefs: Have synthetic events use types pid_t, gfp_t and bool 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=20220131163642.2754485-3-rostedt@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).