]> git.baikalelectronics.ru Git - kernel.git/commit
tools/bpf: add a test for bpf_get_stack with raw tracepoint prog
authorYonghong Song <yhs@fb.com>
Sun, 29 Apr 2018 05:28:15 +0000 (22:28 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 29 Apr 2018 15:45:54 +0000 (08:45 -0700)
commit6a655afc613b3f738b0a7e5685cd006d94ccc138
tree1fc1303c919ac14b3b00564823c056b19e9fcfa4
parent643d20f0180feee26cd9ccf4d6fd8545b8fc5205
tools/bpf: add a test for bpf_get_stack with raw tracepoint prog

The test attached a raw_tracepoint program to raw_syscalls/sys_enter.
It tested to get stack for user space, kernel space and user
space with build_id request. It also tested to get user
and kernel stack into the same buffer with back-to-back
bpf_get_stack helper calls.

If jit is not enabled, the user space application will check
to ensure that the kernel function for raw_tracepoint
___bpf_prog_run is part of the stack.

If jit is enabled, we did not have a reliable way to
verify the kernel stack, so just assume the kernel stack
is good when the kernel stack size is greater than 0.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/test_get_stack_rawtp.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_progs.c