Skip to content

Commit 375f926

Browse files
committed
perf trace: Mark the rlim arg in the prlimit64 and setrlimit syscalls as coming from user space
With that it uses the generic BTF based pretty printer: root@number:~# perf trace -e prlimit64 0.000 ( 0.004 ms): :3417020/3417020 prlimit64(resource: NOFILE, old_rlim: 0x7fb8842fe3b0) = 0 0.126 ( 0.003 ms): Chroot Helper/3417022 prlimit64(resource: NOFILE, old_rlim: 0x7fb8842fdfd0) = 0 12.557 ( 0.005 ms): firefox/3417020 prlimit64(resource: STACK, old_rlim: 0x7ffe9ade1b80) = 0 26.640 ( 0.006 ms): MainThread/3417020 prlimit64(resource: STACK, old_rlim: 0x7ffe9ade1780) = 0 27.553 ( 0.002 ms): Web Content/3417020 prlimit64(resource: AS, old_rlim: 0x7ffe9ade1660) = 0 29.405 ( 0.003 ms): Web Content/3417020 prlimit64(resource: NOFILE, old_rlim: 0x7ffe9ade0c80) = 0 30.471 ( 0.002 ms): Web Content/3417020 prlimit64(resource: RTTIME, old_rlim: 0x7ffe9ade1370) = 0 30.485 ( 0.001 ms): Web Content/3417020 prlimit64(resource: RTTIME, new_rlim: (struct rlimit64){.rlim_cur = (__u64)50000,.rlim_max = (__u64)200000,}) = 0 31.779 ( 0.001 ms): Web Content/3417020 prlimit64(resource: STACK, old_rlim: 0x7ffe9ade1670) = 0 ^Croot@number:~# Better than before, still needs improvements in the configurability of the libbpf BTF dumper to get it to the strace output standard. 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]> Link: https://lore.kernel.org/lkml/ZuBQI-f8CGpuhIdH@x1 Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent f3f1611 commit 375f926

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/perf/builtin-trace.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,8 @@ static const struct syscall_fmt syscall_fmts[] = {
13091309
{ .name = "pread", .alias = "pread64", },
13101310
{ .name = "preadv", .alias = "pread", },
13111311
{ .name = "prlimit64",
1312-
.arg = { [1] = STRARRAY(resource, rlimit_resources), }, },
1312+
.arg = { [1] = STRARRAY(resource, rlimit_resources),
1313+
[2] = { .from_user = true /* new_rlim */, }, }, },
13131314
{ .name = "pwrite", .alias = "pwrite64", },
13141315
{ .name = "readlinkat",
13151316
.arg = { [0] = { .scnprintf = SCA_FDAT, /* dfd */ }, }, },
@@ -1352,7 +1353,8 @@ static const struct syscall_fmt syscall_fmts[] = {
13521353
{ .name = "setitimer",
13531354
.arg = { [0] = STRARRAY(which, itimers), }, },
13541355
{ .name = "setrlimit",
1355-
.arg = { [0] = STRARRAY(resource, rlimit_resources), }, },
1356+
.arg = { [0] = STRARRAY(resource, rlimit_resources),
1357+
[1] = { .from_user = true /* rlim */, }, }, },
13561358
{ .name = "setsockopt",
13571359
.arg = { [1] = STRARRAY(level, socket_level), }, },
13581360
{ .name = "socket",

0 commit comments

Comments
 (0)