OSDN Git Service

selftests/bpf: Add test for bpf_get_branch_snapshot
authorSong Liu <songliubraving@fb.com>
Fri, 10 Sep 2021 18:33:52 +0000 (11:33 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 13 Sep 2021 17:53:50 +0000 (10:53 -0700)
commit025bd7c753aab18cd594924a46ab46ac47209df9
tree2d03c43e8c339f5b95a134cfe802862b65d45d8b
parent856c02dbce4f8d6a5644083db22c11750aa11481
selftests/bpf: Add test for bpf_get_branch_snapshot

This test uses bpf_get_branch_snapshot from a fexit program. The test uses
a target function (bpf_testmod_loop_test) and compares the record against
kallsyms. If there isn't enough record matching kallsyms, the test fails.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20210910183352.3151445-4-songliubraving@fb.com
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
tools/testing/selftests/bpf/prog_tests/core_reloc.c
tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c [new file with mode: 0644]
tools/testing/selftests/bpf/prog_tests/module_attach.c
tools/testing/selftests/bpf/progs/get_branch_snapshot.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_progs.c
tools/testing/selftests/bpf/test_progs.h
tools/testing/selftests/bpf/trace_helpers.c
tools/testing/selftests/bpf/trace_helpers.h