Skip to content

Commit d7a07b2

Browse files
committed
perf trace: Resolve prctl's 'option' arg strings to numbers
# perf trace -e syscalls:sys_enter_prctl --filter="option==SET_NAME" 0.000 Socket Thread/3860 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7fc50b9733e8) 0.053 SSL Cert #78/3860 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7fc50b9733e8) ^C # If one uses '-v' with 'perf trace', we can see the filter it puts in place: New filter for syscalls:sys_enter_prctl: (option==0xf) && (common_pid != 3859 && common_pid != 2757) We still need to allow using plain '-e prctl' and have this turn into creating a 'syscalls:sys_enter_prctl' event so that the filter can be applied only to it as right now '-e prctl' ends up using the 'raw_syscalls:sys_enter/sys_exit'. The end goal is to have something like: # perf trace -e prctl/option==SET_NAME/ And have that use tracepoint filters or eBPF ones. Cc: Adrian Hunter <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mike Christie <[email protected]> Cc: Namhyung Kim <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent c0134b3 commit d7a07b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/perf/builtin-trace.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,9 @@ static struct syscall_fmt syscall_fmts[] = {
10651065
{ .name = "poll", .timeout = true, },
10661066
{ .name = "ppoll", .timeout = true, },
10671067
{ .name = "prctl",
1068-
.arg = { [0] = { .scnprintf = SCA_PRCTL_OPTION, /* option */ },
1068+
.arg = { [0] = { .scnprintf = SCA_PRCTL_OPTION, /* option */
1069+
.strtoul = STUL_STRARRAY,
1070+
.parm = &strarray__prctl_options, },
10691071
[1] = { .scnprintf = SCA_PRCTL_ARG2, /* arg2 */ },
10701072
[2] = { .scnprintf = SCA_PRCTL_ARG3, /* arg3 */ }, }, },
10711073
{ .name = "pread", .alias = "pread64", },

0 commit comments

Comments
 (0)