Commit 44a56040 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Steven Rostedt

perf probe: Fix to show correct error string

Fix perf probe to show correct error string when it
fails to delete an event. The write(2) returns -1
if failed, and errno stores real error number.
Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: stable@kernel.org
Link: http://lkml.kernel.org/r/20111004104504.14591.41266.stgit@fedora15Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 02ca1521
...@@ -1956,8 +1956,10 @@ static int __del_trace_probe_event(int fd, struct str_node *ent) ...@@ -1956,8 +1956,10 @@ static int __del_trace_probe_event(int fd, struct str_node *ent)
pr_debug("Writing event: %s\n", buf); pr_debug("Writing event: %s\n", buf);
ret = write(fd, buf, strlen(buf)); ret = write(fd, buf, strlen(buf));
if (ret < 0) if (ret < 0) {
ret = -errno;
goto error; goto error;
}
printf("Remove event: %s\n", ent->s); printf("Remove event: %s\n", ent->s);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment