Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b3171ec authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Greg Kroah-Hartman
Browse files

tracing: Return -ENOENT if there is no target synthetic event

commit 18858511fd8a877303cc34c06efa461b26a0e070 upstream.

Return -ENOENT error if there is no target synthetic event.
This notices an operation failure to user as below;

  # echo 'wakeup_latency u64 lat; pid_t pid;' > synthetic_events
  # echo '!wakeup' >> synthetic_events
  sh: write error: No such file or directory

Link: http://lkml.kernel.org/r/154013449986.25576.9487131386597290172.stgit@devbox



Acked-by: default avatarTom Zanussi <zanussi@linux.intel.com>
Tested-by: default avatarTom Zanussi <zanussi@linux.intel.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Rajvi Jingar <rajvi.jingar@intel.com>
Cc: stable@vger.kernel.org
Fixes: 4b147936 ('tracing: Add support for 'synthetic' events')
Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1ebadf5e
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1063,8 +1063,10 @@ static int create_synth_event(int argc, char **argv)
		event = NULL;
		event = NULL;
		ret = -EEXIST;
		ret = -EEXIST;
		goto out;
		goto out;
	} else if (delete_event)
	} else if (delete_event) {
		ret = -ENOENT;
		goto out;
		goto out;
	}


	if (argc < 2) {
	if (argc < 2) {
		ret = -EINVAL;
		ret = -EINVAL;