From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Yonghong Song <yhs@fb.com>
Cc: ast@fb.com, daniel@iogearbox.net, netdev@vger.kernel.org,
kernel-team@fb.com
Subject: Re: [PATCH bpf-next v3 9/9] tools/bpf: add a test for bpf_get_stack with tracepoint prog
Date: Sun, 22 Apr 2018 18:27:33 -0600 [thread overview]
Message-ID: <20180423002732.6fw45mevsz3bixkq@ast-mbp> (raw)
In-Reply-To: <20180420221842.742330-10-yhs@fb.com>
On Fri, Apr 20, 2018 at 03:18:42PM -0700, Yonghong Song wrote:
> The test_stacktrace_map and test_stacktrace_build_id are
> enhanced to call bpf_get_stack in the helper to get the
> stack trace as well. The stack traces from bpf_get_stack
> and bpf_get_stackid are compared to ensure that for the
> same stack as represented as the same hash, their ip addresses
> or build id's must be the same.
>
> Signed-off-by: Yonghong Song <yhs@fb.com>
> ---
> tools/testing/selftests/bpf/test_progs.c | 63 +++++++++++++++++++---
> .../selftests/bpf/test_stacktrace_build_id.c | 20 ++++++-
> tools/testing/selftests/bpf/test_stacktrace_map.c | 20 +++++--
> 3 files changed, 92 insertions(+), 11 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
> index dad4c3f..06b922a 100644
> --- a/tools/testing/selftests/bpf/test_progs.c
> +++ b/tools/testing/selftests/bpf/test_progs.c
> @@ -897,11 +897,40 @@ static int compare_map_keys(int map1_fd, int map2_fd)
> return 0;
> }
>
> +static int compare_stack_ips(int smap_fd, int amap_fd, int stack_trace_len)
> +{
> + __u32 key, next_key, *cur_key_p, *next_key_p;
> + char val_buf1[stack_trace_len], val_buf2[stack_trace_len];
the kernel is trying to get rid of VLAs.
test_progs.c already uses them, but if possible let's not
add more uses of them.
Other than that looks great.
next prev parent reply other threads:[~2018-04-23 0:27 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-20 22:18 [PATCH bpf-next v3 0/9] bpf: add bpf_get_stack helper Yonghong Song
2018-04-20 22:18 ` [PATCH bpf-next v3 1/9] bpf: change prototype for stack_map_get_build_id_offset Yonghong Song
2018-04-20 22:18 ` [PATCH bpf-next v3 2/9] bpf: add bpf_get_stack helper Yonghong Song
2018-04-20 22:18 ` [PATCH bpf-next v3 3/9] bpf/verifier: refine retval R0 state for " Yonghong Song
2018-04-22 23:55 ` Alexei Starovoitov
2018-04-23 2:46 ` Yonghong Song
2018-04-20 22:18 ` [PATCH bpf-next v3 4/9] bpf/verifier: improve register value range tracking with ARSH Yonghong Song
2018-04-23 0:16 ` Alexei Starovoitov
2018-04-23 2:49 ` Yonghong Song
2018-04-23 4:19 ` Alexei Starovoitov
2018-04-23 4:31 ` Yonghong Song
2018-04-23 4:40 ` Alexei Starovoitov
2018-04-23 12:25 ` Edward Cree
2018-04-23 16:19 ` Yonghong Song
2018-04-20 22:18 ` [PATCH bpf-next v3 5/9] tools/bpf: add bpf_get_stack helper to tools headers Yonghong Song
2018-04-20 22:18 ` [PATCH bpf-next v3 6/9] samples/bpf: move common-purpose trace functions to selftests Yonghong Song
2018-04-23 0:17 ` Alexei Starovoitov
2018-04-20 22:18 ` [PATCH bpf-next v3 7/9] tools/bpf: add a verifier test case for bpf_get_stack helper and ARSH Yonghong Song
2018-04-20 22:18 ` [PATCH bpf-next v3 8/9] tools/bpf: add a test for bpf_get_stack with raw tracepoint prog Yonghong Song
2018-04-23 0:23 ` Alexei Starovoitov
2018-04-23 2:57 ` Yonghong Song
2018-04-20 22:18 ` [PATCH bpf-next v3 9/9] tools/bpf: add a test for bpf_get_stack with " Yonghong Song
2018-04-23 0:27 ` Alexei Starovoitov [this message]
2018-04-23 2:58 ` Yonghong Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180423002732.6fw45mevsz3bixkq@ast-mbp \
--to=alexei.starovoitov@gmail.com \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox