- Clang编译器。至少需要Clang10,CO-RE需要Clang11或Clang12
- libbpf库
- bpftool可执行性文件,用来生成vmlinux.h和xx_skel.h
- zlib (libz-dev or zlib-devel ) 和 libelf (libelf-dev or elfutils-libelf-devel )
- pkg-config: libbpf-rs使用pkg-config来查找libbpf库
ubuntu 22.04 安装:
apt-get install -y libbpf-dev libz-dev libelf-dev pkg-config clang bpftool
centos stream 9 安装:
yum install -y libbpf zlib-devel elfutils-libelf-devel pkgconf-pkg-config clang bpftool
bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h
yum install -y autoconf gettext-devel flex bison gawk make pkg-config automake
apt-get install -y autoconf autopoint flex bison gawk make pkg-config automake
激活vendored feature