selftests/bpf: Add vmlinux.h selftest exercising tracing of syscalls
authorAndrii Nakryiko <andriin@fb.com>
Fri, 13 Mar 2020 17:23:36 +0000 (10:23 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 Mar 2020 22:30:53 +0000 (23:30 +0100)
commitacbd06206bbbe59ffd2415c0b902dd244910e42e
tree46e7397710281de9f743512c43d65bc279ab4a51
parentb8ebce86ffe655ac15a841bba2d645105ffe3d38
selftests/bpf: Add vmlinux.h selftest exercising tracing of syscalls

Add vmlinux.h generation to selftest/bpf's Makefile. Use it from newly added
test_vmlinux to trace nanosleep syscall using 5 different types of programs:
  - tracepoint;
  - raw tracepoint;
  - raw tracepoint w/ direct memory reads (tp_btf);
  - kprobe;
  - fentry.

These programs are realistic variants of real-life tracing programs,
excercising vmlinux.h's usage with tracing applications.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200313172336.1879637-5-andriin@fb.com
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/vmlinux.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_vmlinux.c [new file with mode: 0644]