aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/module_attach.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2020-12-11 01:59:46 +0000
committerAlexei Starovoitov <[email protected]>2020-12-11 05:16:29 +0000
commita67079b03165a17f9aceab3dd26b1638af68e0fc (patch)
tree50eb1603f3a50f0849bff7cec78e12fb9c38f8bb /tools/testing/selftests/bpf/prog_tests/module_attach.c
parentsamples/bpf: Fix possible hang in xdpsock with multiple threads (diff)
downloadkernel-a67079b03165a17f9aceab3dd26b1638af68e0fc.tar.gz
kernel-a67079b03165a17f9aceab3dd26b1638af68e0fc.zip
selftests/bpf: fix bpf_testmod.ko recompilation logic
bpf_testmod.ko build rule declared dependency on VMLINUX_BTF, but the variable itself was initialized after the rule was declared, which often caused bpf_testmod.ko to not be re-compiled. Fix by moving VMLINUX_BTF determination sooner. Also enforce bpf_testmod.ko recompilation when we detect that vmlinux image changed by removing bpf_testmod/bpf_testmod.ko. This is necessary to generate correct module's split BTF. Without it, Kbuild's module build logic might determine that nothing changed on the kernel side and thus bpf_testmod.ko shouldn't be rebuilt, so won't re-generate module BTF, which often leads to module's BTF with wrong string offsets against vmlinux BTF. Removing .ko file forces Kbuild to re-build the module. Reported-by: Alexei Starovoitov <[email protected]> Fixes: 9f7fa225894c ("selftests/bpf: Add bpf_testmod kernel module for testing") Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/module_attach.c')
0 files changed, 0 insertions, 0 deletions