From: Arnaldo Carvalho de Melo Date: Mon, 17 Dec 2018 15:06:34 +0000 (-0300) Subject: perf trace: Enclose the errno strings with () X-Git-Tag: v5.0-rc1~149^2^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c83dfae021306d528b21dceb8d128ca16524c5a;p=thirdparty%2Flinux.git 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) Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-krxl6klsqc9qyktoaxyih942@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 226e994ac6387..35d8fbe47ee49 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -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 = {