OSDN Git Service

perf trace: Resolve prctl's 'option' arg strings to numbers
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 11 Feb 2020 18:54:08 +0000 (15:54 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 11 Feb 2020 19:41:50 +0000 (16:41 -0300)
commitd7a07b293216e5561705303751bc0d213e9fb328
tree3647e01b66f4fe366722f78ae24e018058911308
parentc0134b3366ba5f0aba41d56006b574d3be7f5ed3
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 <adrian.hunter@intel.com>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c