Skip to content

Commit 39c6a35

Browse files
committed
perf trace: The return from 'write' isn't a pid
When adding a explicit beautifier for the 'write' syscall when the BPF based buffer collector was introduced there was a cut'n'paste error that carried the syscall_fmt->errpid setting from a nearby syscall (waitid) that returns a pid. So the write return was being suppressed by the return pretty printer, remove that field, reverting it back to the default return handler, that prints positive numbers as-is and interpret negative values as errnos. I actually introduced the problem while making Howard's original patch work just with the 'write' syscall, as we couldn't just look for any buffers, the ones that are filled in by the kernel couldn't use the same sys_enter BPF collector. Fixes: b257fac ("perf trace: Pretty print buffer data") Reported-by: James Clark <[email protected]> Link: https://lore.kernel.org/lkml/[email protected] Link: https://lore.kernel.org/all/Zt8jTfzDYgBPvFCd@x1/#t Cc: Adrian Hunter <[email protected]> Cc: Alan Maguire <[email protected]> Cc: Howard Chu <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Namhyung Kim <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ab8aaab commit 39c6a35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/builtin-trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ static const struct syscall_fmt syscall_fmts[] = {
13991399
.arg = { [2] = { .scnprintf = SCA_WAITID_OPTIONS, /* options */ }, }, },
14001400
{ .name = "waitid", .errpid = true,
14011401
.arg = { [3] = { .scnprintf = SCA_WAITID_OPTIONS, /* options */ }, }, },
1402-
{ .name = "write", .errpid = true,
1402+
{ .name = "write",
14031403
.arg = { [1] = { .scnprintf = SCA_BUF /* buf */, .from_user = true, }, }, },
14041404
};
14051405

0 commit comments

Comments
 (0)