[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <064d7362-6c04-7f60-30e6-1e7dff0cf0fb@fb.com>
Date: Thu, 19 Apr 2018 16:42:02 -0700
From: Yonghong Song <yhs@...com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
CC: <ast@...com>, <daniel@...earbox.net>, <netdev@...r.kernel.org>,
<kernel-team@...com>
Subject: Re: [PATCH bpf-next v2 7/9] samples/bpf: add a test for bpf_get_stack
helper
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 <yhs@...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.
Powered by blists - more mailing lists