Skip to content

Commit a360d9e

Browse files
mhiramatrostedt
authored andcommitted
tracing: Fix synthetic event to allow semicolon at end
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. Link: http://lkml.kernel.org/r/153986835420.18251.2191216690677025744.stgit@devbox Cc: Shuah Khan <shuah@kernel.org> Cc: Tom Zanussi <tom.zanussi@linux.intel.com> Cc: stable@vger.kernel.org Fixes: commit 4b14793 ("tracing: Add support for 'synthetic' events") Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 282447b commit a360d9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_events_hist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ static int create_synth_event(int argc, char **argv)
10881088
i += consumed - 1;
10891089
}
10901090

1091-
if (i < argc) {
1091+
if (i < argc && strcmp(argv[i], ";") != 0) {
10921092
ret = -EINVAL;
10931093
goto err;
10941094
}

0 commit comments

Comments
 (0)