Re: Error: failed to load BTF from vmlinux: No data available

From: Andrii Nakryiko
Date: Tue May 16 2023 - 13:29:35 EST


On Mon, May 15, 2023 at 7:43 PM kernel test robot <lkp@xxxxxxxxx> wrote:
>
> Hi Changbin,
>
> FYI, the error/warning still remains.
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: f1fcbaa18b28dec10281551dfe6ed3a3ed80e3d6
> commit: acd3b7768048fe338248cdf43ccfbf8c084a6bc1 libbpf: Return -ENODATA for missing btf section
> date: 4 months ago
> compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
> reproduce:
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=acd3b7768048fe338248cdf43ccfbf8c084a6bc1
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout acd3b7768048fe338248cdf43ccfbf8c084a6bc1
> make O=/tmp/kselftest headers
> make O=/tmp/kselftest -C tools/testing/selftests
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Link: https://lore.kernel.org/oe-kbuild-all/202305161058.hUHyPIjv-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> libbpf: failed to find '.BTF' ELF section in vmlinux
> >> Error: failed to load BTF from vmlinux: No data available
> --
> libbpf: failed to find '.BTF' ELF section in vmlinux
> >> Error: failed to load BTF from vmlinux: No data available
> make[3]: *** [Makefile:204: tools/bpf/bpftool/vmlinux.h] Error 195
> make[3]: *** Deleting file 'tools/bpf/bpftool/vmlinux.h'
> make[2]: *** [Makefile:113: bpftool] Error 2
> make[2]: *** Waiting for unfinished jobs....
> libbpf: failed to find '.BTF' ELF section in vmlinux
> >> Error: failed to load BTF from vmlinux: No data available
> make[3]: *** [Makefile:76: tools/bpf/runqslower//vmlinux.h] Error 195
> make[3]: *** Deleting file 'tools/bpf/runqslower//vmlinux.h'
> make[2]: *** [Makefile:122: runqslower] Error 2
>

Do you enable CONFIG_DEBUG_INFO_BTF=y for this test? retsnoop's
Makefile expects to find .BTF section in vmlinux image to be able to
compiler everything correctly.

> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests