'Error compiling eBPF C code inside kernel tree

I'm compiling the eBPf programs inside Linux kernel tree, after I run the command sudo make headers_install && sudo make M=samples/bpf, I got the following error:

Error: failed to load BTF from /home/linux-5.17.2/vmlinux: Unknown error -2
make[1]: *** [samples/bpf/Makefile:371: samples/bpf/vmlinux.h] Error 254
make[1]: *** Deleting file 'samples/bpf/vmlinux.h'
make: *** [Makefile:1832: samples/bpf] Error 2

Any help?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source