tools/bpf: add a test for bpf_get_stack with tracepoint prog
authorYonghong Song <yhs@fb.com>
Sun, 29 Apr 2018 05:28:16 +0000 (22:28 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 29 Apr 2018 15:45:54 +0000 (08:45 -0700)
commit79b45350131057250236e162ce7b3c0b291dc0a4
tree6aeacaea9a6182914c6e79e073e9f279f57d7cf2
parent173965fbfba596c02fa128966c2a33cb88afcd7f
tools/bpf: add a test for bpf_get_stack with tracepoint prog

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.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_progs.c
tools/testing/selftests/bpf/test_stacktrace_build_id.c
tools/testing/selftests/bpf/test_stacktrace_map.c