On 4/18/18 9:37 PM, Alexei Starovoitov wrote:
On Wed, Apr 18, 2018 at 09:54:42AM -0700, Yonghong Song wrote:
The test attached a kprobe program to kernel function sys_write.
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.
Whenever the kernel stack is available, the user space
application will check to ensure that sys_write/SyS_write
is part of the stack.
Signed-off-by: Yonghong Song <y...@fb.com>
---
samples/bpf/Makefile | 4 +
samples/bpf/trace_get_stack_kern.c | 86 +++++++++++++++++++++
samples/bpf/trace_get_stack_user.c | 150 +++++++++++++++++++++++++++++++++++++
3 files changed, 240 insertions(+)
since perf_read is being refactored out of trace_output_user.c in the previous
patch
please move it to selftests (instead of bpf_load.c) and move
this whole test to selftests as well.
I put it here since I am attaching to a kprobe so that I can compare
address. I guess I can still do it by attaching to a kernel tracepoint.
Will move the tests to selftests as suggested.