linux-xiaomi-chiron/tools/perf/trace/beauty
Arnaldo Carvalho de Melo f3cf7fa963 perf trace beauty: Use the autogenerated protocol family table
That helps us not to lose new protocol families when they are
introduced, replacing that hardcoded, dated family->string table.

To recap what this allows us to do:

  # perf trace -e syscalls:sys_enter_socket/max-stack=10/ --filter=family==INET --max-events=1
     0.000 fetchmail/41097 syscalls:sys_enter_socket(family: INET, type: DGRAM|CLOEXEC|NONBLOCK, protocol: IP)
                                       __GI___socket (inlined)
                                       reopen (/usr/lib64/libresolv-2.31.so)
                                       send_dg (/usr/lib64/libresolv-2.31.so)
                                       __res_context_send (/usr/lib64/libresolv-2.31.so)
                                       __GI___res_context_query (inlined)
                                       __GI___res_context_search (inlined)
                                       _nss_dns_gethostbyname4_r (/usr/lib64/libnss_dns-2.31.so)
                                       gaih_inet.constprop.0 (/usr/lib64/libc-2.31.so)
                                       __GI_getaddrinfo (inlined)
                                       [0x15cb2] (/usr/bin/fetchmail)
  #

More work is still needed to allow for the more natura strace-like
syscall name usage instead of the trace event name:

  # perf trace -e socket/max-stack=10,family==INET/ --max-events=1

I.e. to allow for modifiers to follow the syscall name and for logical
expressions to be accepted as filters to use with that syscall, be it as
trace event filters or BPF based ones.

Using -v we can see how the trace event filter is built:

  # perf trace -v -e syscalls:sys_enter_socket/call-graph=dwarf/ --filter=family==INET --max-events=2
  <SNIP>
  New filter for syscalls:sys_enter_socket: (family==0x2) && (common_pid != 41384 && common_pid != 2836)
  <SNIP>

  $ tools/perf/trace/beauty/socket.sh | grep -w 2
	[2] = "INET",
  $

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-08-12 08:43:51 -03:00
..
include/linux perf trace beauty: Add script to autogenerate socket families table 2020-08-12 08:38:36 -03:00
tracepoints
arch_errno_names.c
arch_errno_names.sh perf beauty: Allow the CC used in the arch errno names script to acccept CFLAGS 2020-05-28 10:03:26 -03:00
arch_prctl.c
beauty.h
Build
clone.c
drm_ioctl.sh
eventfd.c
fadvise.sh
fcntl.c
flock.c
fsconfig.sh
fsmount.c
fsmount.sh
fspick.c
fspick.sh
futex_op.c
futex_val3.c
ioctl.c
kcmp.c
kcmp_type.sh
kvm_ioctl.sh
madvise_behavior.sh
mmap.c tools headers UAPI: Sync linux/mman.h with the kernel 2020-04-14 09:04:53 -03:00
mmap_flags.sh
mode_t.c
mount_flags.c
mount_flags.sh
move_mount.c
move_mount_flags.sh
msg_flags.c
open_flags.c
perf_event_open.c
perf_ioctl.sh
pid.c
pkey_alloc.c
pkey_alloc_access_rights.sh
prctl.c
prctl_option.sh
rename_flags.sh
renameat.c
sched_policy.c
seccomp.c
signum.c
sndrv_ctl_ioctl.sh
sndrv_pcm_ioctl.sh
sockaddr.c perf trace beauty: Use the autogenerated protocol family table 2020-08-12 08:43:51 -03:00
socket.c
socket.sh perf trace beauty: Add script to autogenerate socket families table 2020-08-12 08:38:36 -03:00
socket_ipproto.sh
socket_type.c
statx.c perf beauty: Add support to STATX_MNT_ID in the 'statx' syscall 'mask' argument 2020-06-09 12:40:03 -03:00
sync_file_range.c
sync_file_range.sh
usbdevfs_ioctl.sh
vhost_virtio_ioctl.sh
waitid_options.c
x86_arch_prctl.sh