Skip to content

Commit 44a5604

Browse files
mhiramathitachirostedt
authored andcommitted
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: 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> Cc: stable@kernel.org Link: http://lkml.kernel.org/r/20111004104504.14591.41266.stgit@fedora15 Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 02ca152 commit 44a5604

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎tools/perf/util/probe-event.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1956,8 +1956,10 @@ static int __del_trace_probe_event(int fd, struct str_node *ent)
19561956

19571957
pr_debug("Writing event: %s\n", buf);
19581958
ret = write(fd, buf, strlen(buf));
1959-
if (ret < 0)
1959+
if (ret < 0) {
1960+
ret = -errno;
19601961
goto error;
1962+
}
19611963

19621964
printf("Remove event: %s\n", ent->s);
19631965
return 0;

0 commit comments

Comments
 (0)