]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Clarify build error if no vmlinux
authorKamal Mostafa <kamal@canonical.com>
Tue, 15 Dec 2020 18:20:10 +0000 (10:20 -0800)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 16 Dec 2020 18:04:34 +0000 (10:04 -0800)
commitd2d9173346a1c8cb30f283aab9f5d87935a9c1d6
tree9996e1f95656772fb5e75e71a0dca869ae6339fc
parentfc09518e8213357ea07d8523c6bb59b397c201a6
selftests/bpf: Clarify build error if no vmlinux

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: b26d7b039eed ("selftests/bpf: Add vmlinux.h selftest exercising tracing of syscalls")
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20201215182011.15755-1-kamal@canonical.com
tools/testing/selftests/bpf/Makefile