linux-stable/tools/testing
Andrii Nakryiko a67079b031 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 <ast@kernel.org>
Fixes: 9f7fa22589 ("selftests/bpf: Add bpf_testmod kernel module for testing")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20201211015946.4062098-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2020-12-10 21:16:29 -08:00
..
fault-injection
ktest Updates for ktest 5.9 2020-08-10 19:16:26 -07:00
kunit kunit: tool: fix extra trailing \n in raw + parsed test output 2020-11-10 13:44:35 -07:00
nvdimm device-dax: add dis-contiguous resource support 2020-10-13 18:38:28 -07:00
radix-tree ida: Free allocated bitmap in error path 2020-10-07 09:11:33 -04:00
scatterlist tools/testing/scatterlist: Fix test to compile and run 2020-11-17 20:02:20 -04:00
selftests selftests/bpf: fix bpf_testmod.ko recompilation logic 2020-12-10 21:16:29 -08:00
vsock