summaryrefslogtreecommitdiff
path: root/tools/perf/check-headers.sh
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2020-08-12 14:43:51 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-08-12 14:43:51 +0300
commitf3cf7fa963c46391da54a0e50f54c089c9b4c450 (patch)
tree6d69dfbc1f59878f0a0412376f23a5fd336b2602 /tools/perf/check-headers.sh
parent58277f502f429baee11725ca2d8cb3c43c7a6429 (diff)
downloadlinux-f3cf7fa963c46391da54a0e50f54c089c9b4c450.tar.xz
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>
Diffstat (limited to 'tools/perf/check-headers.sh')
-rwxr-xr-xtools/perf/check-headers.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index 94c2bc22c2bb..0b4d6431b072 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -128,6 +128,9 @@ check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in
# diff non-symmetric files
check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
+# These will require a beauty_check when we get some more like that
+check_2 tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h
+
# check duplicated library files
check_2 tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h
check_2 tools/perf/util/hashmap.c tools/lib/bpf/hashmap.c