]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID
authorSong Liu <songliubraving@fb.com>
Wed, 14 Mar 2018 17:23:22 +0000 (10:23 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 15 Mar 2018 00:10:02 +0000 (01:10 +0100)
commit57748a0aec9ca68b9aea3acf0a7579f5f7ea1c10
treebebe74af6f86ad63719e1d50442482a51a6beedf
parent83a356ec2db30299c00f7737b5507133063529f6
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>
tools/include/uapi/linux/bpf.h
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/test_progs.c
tools/testing/selftests/bpf/test_stacktrace_build_id.c [new file with mode: 0644]
tools/testing/selftests/bpf/urandom_read.c [new file with mode: 0644]