diff mbox series

[2/4] libtracefs: Fix tracefs_synth_echo_cmd()

Message ID 20220131163642.2754485-3-rostedt@goodmis.org (mailing list archive)
State Accepted
Commit 29a06f7619b419146920ed38e4dce880eb769077
Headers show
Series libtracefs: synthetic event fixes | expand

Commit Message

Steven Rostedt Jan. 31, 2022, 4:36 p.m. UTC
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 mbox series

Patch

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);