Skip to contentSkip to conversation

perf trace: Enclose the errno strings with ()

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Dec 20, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  2c83dfae021306d528b21dceb8d128ca16524c5a
Gitweb:     https://git.kernel.org/tip/2c83dfae021306d528b21dceb8d128ca16524c5a
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 17 Dec 2018 12:06:34 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 18 Dec 2018 16:15:18 -0300

perf trace: Enclose the errno strings with ()

To match strace, now both emit the same line for calls like:

access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)

---
 tools/perf/builtin-trace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-trace.c +2 -2
index 226e994ac638..35d8fbe47ee4 100644
@@ -2024,10 +2024,10 @@ errno_print: {
 		const char *emsg = str_error_r(-ret, bf, sizeof(bf)),
 			   *e = errno_to_name(evsel, -ret);
 
-		fprintf(trace->output, "-1 %s %s", e, emsg);
+		fprintf(trace->output, "-1 %s (%s)", e, emsg);
 	}
 	} else if (ret == 0 && sc->fmt->timeout)
-		fprintf(trace->output, "0 Timeout");
+		fprintf(trace->output, "0 (Timeout)");
 	else if (ttrace->ret_scnprintf) {
 		char bf[1024];
 		struct syscall_arg arg = {