]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add tests for libbpf-provided externs
authorAndrii Nakryiko <andriin@fb.com>
Sat, 14 Dec 2019 01:47:10 +0000 (17:47 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 16 Dec 2019 00:41:12 +0000 (16:41 -0800)
commit223373d074bc08348eb222009812ef9ef3194100
tree7f0220e2dd38b8f7c99c9b4780c97cd6513be982
parent79609fb1e4b1e3b0f02dda3ee7638223d8e0221e
selftests/bpf: Add tests for libbpf-provided externs

Add a set of tests validating libbpf-provided extern variables. One crucial
feature that's tested is dead code elimination together with using invalid BPF
helper. CONFIG_MISSING is not supposed to exist and should always be specified
by libbpf as zero, which allows BPF verifier to correctly do branch pruning
and not fail validation, when invalid BPF helper is called from dead if branch.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191214014710.3449601-5-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/core_extern.c [new file with mode: 0644]
tools/testing/selftests/bpf/prog_tests/skeleton.c
tools/testing/selftests/bpf/progs/test_core_extern.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_skeleton.c