tracing: Return -ENOENT if there is no target synthetic event
authorMasami Hiramatsu <mhiramat@kernel.org>
Sun, 21 Oct 2018 15:08:20 +0000 (00:08 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:56 +0000 (11:08 -0800)
commit2b3171ec5ae0471bdef9dc1141b3ed8dd94c8532
tree8d7db3a130d2ee586fb36dc986bf5d2bb8cc5369
parent1ebadf5ef7f51b924d4f11863c495107ccbc6827
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: Tom Zanussi <zanussi@linux.intel.com>
Tested-by: Tom Zanussi <zanussi@linux.intel.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Rajvi Jingar <rajvi.jingar@intel.com>
Cc: stable@vger.kernel.org
Fixes: 4b147936fa50 ('tracing: Add support for 'synthetic' events')
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_events_hist.c