bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID
test_stacktrace_build_id() is added. It accesses tracepoint urandom_read with "dd" and "urandom_read" and gathers stack traces. Then it reads the stack traces from the stackmap. urandom_read is a statically link binary that reads from /dev/urandom. test_stacktrace_build_id() calls readelf to read build ID of urandom_read and compares it with build ID from the stackmap. Signed-off-by:Song Liu <songliubraving@fb.com> Signed-off-by:
Daniel Borkmann <daniel@iogearbox.net>
Showing
- tools/include/uapi/linux/bpf.h 22 additions, 0 deletionstools/include/uapi/linux/bpf.h
- tools/testing/selftests/bpf/Makefile 11 additions, 1 deletiontools/testing/selftests/bpf/Makefile
- tools/testing/selftests/bpf/test_progs.c 163 additions, 1 deletiontools/testing/selftests/bpf/test_progs.c
- tools/testing/selftests/bpf/test_stacktrace_build_id.c 60 additions, 0 deletionstools/testing/selftests/bpf/test_stacktrace_build_id.c
- tools/testing/selftests/bpf/urandom_read.c 22 additions, 0 deletionstools/testing/selftests/bpf/urandom_read.c
Loading
Please register or sign in to comment