OSDN Git Service

selftests/bpf: Additional test for CO-RE in the kernel.
authorAlexei Starovoitov <ast@kernel.org>
Wed, 1 Dec 2021 18:10:38 +0000 (10:10 -0800)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 2 Dec 2021 19:18:36 +0000 (11:18 -0800)
commit26b367e3663931f2fee5f0786a1eff712e67b0bf
tree2d6d65500a663878e0aab1e2cb09ca639d005c06
parent650c9dbd101ba7d7180f4e77deb1c273f4ea5ca3
selftests/bpf: Additional test for CO-RE in the kernel.

Add a test where randmap() function is appended to three different bpf
programs. That action checks struct bpf_core_relo replication logic
and offset adjustment in gen loader part of libbpf.

Fourth bpf program has 360 CO-RE relocations from vmlinux, bpf_testmod,
and non-existing type. It tests candidate cache logic.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211201181040.23337-16-alexei.starovoitov@gmail.com
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/core_kern.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/core_kern.c [new file with mode: 0644]