xdp-project / xdp-tutorial

XDP tutorial
2.33k stars 562 forks source link

libbpf: failed to find BTF for extern 'get_nprocs' [59] section: -2 libxdp: Couldn't load the eBPF program (libbpf said 'no such file'). Maybe the program was compiled with a too old version of LLVM (need v9.0+)? #341

Open hiqsociety opened 1 year ago

hiqsociety commented 1 year ago

trying to add get_nprocs() here ./xdpfilt_prog.h can anyone help to resolve this? thx


#include <linux/bpf.h>
#include <linux/in.h>
#include <bpf/bpf_helpers.h>
#include <xdp/xdp_helpers.h>
#include <sys/sysinfo.h>

#include "common_kern_user.h"

/* Defines xdp_stats_map */
#include "xdp/xdp_stats_kern.h"
#include "xdp/parsing_helpers.h"
libbpf: failed to find BTF for extern 'get_nprocs' [59] section: -2
libxdp: Couldn't load the eBPF program (libbpf said 'no such file').
Maybe the program was compiled with a too old version of LLVM (need v9.0+)?
Couldn't load BPF program: No such file or directory(-2)