linux/tools/perf/trace/beauty
Arnaldo Carvalho de Melo 83bc9c371e perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments
Reuse 'mprotect' beautifiers for 'pkey_mprotect'.

System wide tracing pkey_alloc, pkey_free and pkey_mprotect calls, with
backtraces:

  # perf trace -e pkey_alloc,pkey_mprotect,pkey_free --max-stack=5
     0.000 ( 0.011 ms): pkey/7818 pkey_alloc(init_val: DISABLE_ACCESS|DISABLE_WRITE) = -1 EINVAL Invalid argument
                                       syscall (/usr/lib64/libc-2.25.so)
                                       pkey_alloc (/home/acme/c/pkey)
     0.022 ( 0.003 ms): pkey/7818 pkey_mprotect(start: 0x7f28c3890000, len: 4096, prot: READ|WRITE, pkey: -1) = 0
                                       syscall (/usr/lib64/libc-2.25.so)
                                       pkey_mprotect (/home/acme/c/pkey)
     0.030 ( 0.002 ms): pkey/7818 pkey_free(pkey: -1                               ) = -1 EINVAL Invalid argument
                                       syscall (/usr/lib64/libc-2.25.so)
                                       pkey_free (/home/acme/c/pkey)

The tools/include/uapi/asm-generic/mman-common.h file is used to find
the access rights defines for the pkey_alloc syscall second argument.

Since we have the detector of changes for the tools/include header files
versus its kernel origin (include/uapi/asm-generic/mman-common.h), we'll
get whatever new flag appears for that argument automatically.

This method should be used in other cases where it is easy to generate
those flags tables because the header has properly namespaced defines
like PKEY_DISABLE_ACCESS and PKEY_DISABLE_WRITE.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-3xq5312qlks7wtfzv2sk3nct@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-08-28 16:44:47 -03:00
..
beauty.h perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments 2017-08-28 16:44:47 -03:00
Build perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments 2017-08-28 16:44:47 -03:00
clone.c perf trace beauty clone: Suppress unused args according to 'flags' arg 2017-07-20 11:03:10 -03:00
drm_ioctl.sh perf trace beauty ioctl: Beautify DRM ioctl cmds 2017-08-01 13:02:05 -03:00
eventfd.c
fcntl.c perf trace beauty fcntl: Beautify the 'arg' for DUPFD 2017-07-18 23:14:26 -03:00
flock.c
futex_op.c
ioctl.c perf trace beautify ioctl: Beautify perf ioctl's 'cmd' arg 2017-08-01 13:33:50 -03:00
kvm_ioctl.sh perf trace beautify ioctl: Beautify KVM ioctl's 'cmd' arg 2017-08-01 13:02:52 -03:00
mmap.c perf trace beauty mmap: Ignore 'fd' and 'offset' args for MAP_ANONYMOUS 2017-07-20 09:55:51 -03:00
mode_t.c
msg_flags.c
open_flags.c
perf_event_open.c
perf_ioctl.sh perf trace beautify ioctl: Beautify perf ioctl's 'cmd' arg 2017-08-01 13:33:50 -03:00
pid.c perf trace beauty: Export the pid beautifier for use in more places 2017-07-18 23:14:04 -03:00
pkey_alloc_access_rights.sh perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments 2017-08-28 16:44:47 -03:00
pkey_alloc.c perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments 2017-08-28 16:44:47 -03:00
sched_policy.c
seccomp.c
signum.c
sndrv_ctl_ioctl.sh perf trace beautify ioctl: Beautify sound ioctl's 'cmd' arg 2017-08-01 13:02:40 -03:00
sndrv_pcm_ioctl.sh perf trace beautify ioctl: Beautify sound ioctl's 'cmd' arg 2017-08-01 13:02:40 -03:00
socket_type.c
statx.c
vhost_virtio_ioctl.sh perf trace beautify ioctl: Beautify vhost virtio ioctl's 'cmd' arg 2017-08-01 13:32:46 -03:00
waitid_options.c