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

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: 4b147936fa ('tracing: Add support for 'synthetic' events')
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
Masami Hiramatsu 2018-10-22 00:08:20 +09:00 коммит произвёл Steven Rostedt (VMware)
Родитель ba0e41ca81
Коммит 18858511fd
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

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