selftests/bpf: make veristat skip non-BPF and failing-to-open BPF objects
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 23 Sep 2022 17:59:11 +0000 (10:59 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 24 Sep 2022 01:14:45 +0000 (18:14 -0700)
commit518fee8bfaf2c628007909c0fc5336930b9b6ee4
treebec5351da6be6d4c6faaafe20a4953cd56b2e09f
parentc2488d70ceee352611e55943c25abf30117e3b67
selftests/bpf: make veristat skip non-BPF and failing-to-open BPF objects

Make veristat ignore non-BPF object files. This allows simpler
mass-verification (e.g., `sudo ./veristat *.bpf.o` in selftests/bpf
directory). Note that `sudo ./veristat *.o` would also work, but with
selftests's multiple copies of BPF object files (.bpf.o and
.bpf.linked{1,2,3}.o) it's 4x slower.

Also, given some of BPF object files could be incomplete in the sense
that they are meant to be statically linked into final BPF object file
(like linked_maps, linked_funcs, linked_vars), note such instances in
stderr, but proceed anyways. This seems like a better trade off between
completely silently ignoring BPF object file and aborting
mass-verification altogether.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20220923175913.3272430-4-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/veristat.c