Stable Archive on
 help / color / Atom feed
From: Masami Hiramatsu <>
To: Steven Rostedt <>, Shuah Khan <>
Cc: Tom Zanussi <>,
	Masami Hiramatsu <>,,,
	Tom Zanussi <>
Subject: [PATCH v2 2/3] tracing: Fix synthetic event to allow semicolon at end
Date: Thu, 18 Oct 2018 22:12:34 +0900
Message-ID: <153986835420.18251.2191216690677025744.stgit@devbox> (raw)
In-Reply-To: <153986829702.18251.1286066460999338772.stgit@devbox>

Fix synthetic event to allow independent semicolon at end.

The synthetic_events interface accepts a semicolon after the
last word if there is no space.

 # echo "myevent u64 var;" >> synthetic_events

But if there is a space, it returns an error.

 # echo "myevent u64 var ;" > synthetic_events
 sh: write error: Invalid argument

This behavior is difficult for users to understand. Let's
allow the last independent semicolon too.

Fixes: commit 4b147936fa50 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Masami Hiramatsu <>
Cc: Tom Zanussi <>
Cc: Steven Rostedt <>
 kernel/trace/trace_events_hist.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 6ff83941065a..d239004aaf29 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -1088,7 +1088,7 @@ static int create_synth_event(int argc, char **argv)
 		i += consumed - 1;
-	if (i < argc) {
+	if (i < argc && strcmp(argv[i], ";") != 0) {
 		ret = -EINVAL;
 		goto err;

      parent reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <153986829702.18251.1286066460999338772.stgit@devbox>
2018-10-18 13:12 ` [PATCH v2 1/3] tracing: Fix synthetic event to accept unsigned modifier Masami Hiramatsu
2018-10-18 13:12 ` Masami Hiramatsu [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=153986835420.18251.2191216690677025744.stgit@devbox \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Stable Archive on

Archives are clonable:
	git clone --mirror stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ \
	public-inbox-index stable

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone