aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2011-10-04 06:45:04 -0400
committerHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>2011-11-21 12:54:59 -0500
commit1a43f02b8ad310e766d48ba7c723c3d5b1287e44 (patch)
tree622a738bc13c3dc0a71a6257937b45b6b9606753 /tools/perf/util
parent5669de653e363cfaf2a2c7c48ea224a730f5a7a9 (diff)
perf probe: Fix to show correct error string
BugLink: http://bugs.launchpad.net/bugs/890952 commit 44a56040a0037a845d5fa218dffde464579f0cab upstream. 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: Masami 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> Link: http://lkml.kernel.org/r/20111004104504.14591.41266.stgit@fedora15 Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/probe-event.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index f0223166e76..8c50da86885 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -1869,8 +1869,10 @@ static int __del_trace_probe_event(int fd, struct str_node *ent)
1869 1869
1870 pr_debug("Writing event: %s\n", buf); 1870 pr_debug("Writing event: %s\n", buf);
1871 ret = write(fd, buf, strlen(buf)); 1871 ret = write(fd, buf, strlen(buf));
1872 if (ret < 0) 1872 if (ret < 0) {
1873 ret = -errno;
1873 goto error; 1874 goto error;
1875 }
1874 1876
1875 printf("Remove event: %s\n", ent->s); 1877 printf("Remove event: %s\n", ent->s);
1876 return 0; 1878 return 0;