]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
UBUNTU: SAUCE: selftests/bpf: clarify build error if no vmlinux
authorKamal Mostafa <kamal@canonical.com>
Mon, 14 Dec 2020 22:00:38 +0000 (14:00 -0800)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 15 Dec 2020 08:58:04 +0000 (09:58 +0100)
commitfa1f62dbeec1d21122a74eda15ceb79d524fb9ad
treed992c60e9aaac3ec35cbb76d2cf512af3f72b43a
parentce05f46b1f24f20edf135260912205b6a9d79966
UBUNTU: SAUCE: selftests/bpf: clarify build error if no vmlinux

BugLink: https://bugs.launchpad.net/bugs/1908144
If Makefile cannot find any of the vmlinux's in its VMLINUX_BTF_PATHS list,
it tries to run btftool incorrectly, with VMLINUX_BTF unset:

    bpftool btf dump file $(VMLINUX_BTF) format c

Such that the keyword 'format' is misinterpreted as the path to vmlinux.
The resulting build error message is fairly cryptic:

      GEN      vmlinux.h
    Error: failed to load BTF from format: No such file or directory

This patch makes the failure reason clearer by yielding this instead:

    Makefile:...: *** cannot find a vmlinux for VMLINUX_BTF at any of
    "{paths}".  Stop.

Fixes: acbd06206bbb ("selftests/bpf: Add vmlinux.h selftest exercising tracing of syscalls")
Cc: stable@vger.kernel.org # 5.7+
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Reference: https://lore.kernel.org/bpf/20201214202049.7205-1-kamal@canonical.com/
tools/testing/selftests/bpf/Makefile