OSDN Git Service

selftests/bpf: Add CO-RE relocs selftest relying on kernel module BTF
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 3 Dec 2020 20:46:28 +0000 (12:46 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Dec 2020 01:38:21 +0000 (17:38 -0800)
commit6bcd39d366b64318562785d5b47c2837e3a53ae5
treed3a614e46acf0c5ed6cea426844777ecebae09d0
parent5ed31472b9ad6373a0a24bc21186b5eac999213d
selftests/bpf: Add CO-RE relocs selftest relying on kernel module BTF

Add a self-tests validating libbpf is able to perform CO-RE relocations
against the type defined in kernel module BTF. if bpf_testmod.o is not
supported by the kernel (e.g., due to version mismatch), skip tests, instead
of failing.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201203204634.1325171-9-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/core_reloc.c
tools/testing/selftests/bpf/progs/core_reloc_types.h
tools/testing/selftests/bpf/progs/test_core_reloc_module.c [new file with mode: 0644]