1# libbpf-rs tests 2 3libbpf-rs tests are designed to be independent of libbpf-cargo and underlying 4compiler versions. To that end, we check in pre-compiled bpf object files in 5`libbpf-rs/tests/bin`. To help with writing new tests, the original source 6code for the pre-compiled objects are placed in `libbpf-rs/tests/bin/src`. 7 8To regenerate the test bpf object files 9run bpf_object_regen.sh script via the command: 10$ ./bpf_object_regen.sh 11 12The script bpf_object_regen.sh depends on the following packages installed: 13 14bash 15bpftool (optional) 16clang 17libbpf 18 19Installation Instructions for common distributions 20 21Ubuntu 21.10+: (should work with 20.10+ (untested), 20.04 will not work!!) 22required: 23$ apt install bash clang libbpf-dev 24optional: 25$ apt install linux-tools-generic 26Note: bin/src/runqslower.bpf.c requires a vmlinux.h generated from kernel 5.14+ 27 28Debian 11+: 29required: 30$ apt install bash clang libbpf-dev 31optional: 32$ apt install bpftool 33Note: bin/src/runqslower.bpf.c requires a vmlinux.h generated from kernel 5.14+ 34Note: requires running with 35$ PATH=$PATH:/usr/sbin/ ./bpf_object_regen.sh -b ... 36 37Arch Linux: (tested as of 2021/12/16) 38required: 39$ pacman -S bash clang libbpf 40optional: 41$ pacman -S bpf 42 43Fedora 35+, Centos Stream 9: (should work with Fedora 34 (untested), RHEL 9 (untested)) 44required: 45$ dnf install bash clang libbpf-devel 46optional: 47$ dnf install bpftool 48 49Alma Linux 8.5+: (should work with Centos-Stream-8 (untested) and derivatives eg RHEL 8.5 (untested)) 50required: 51$ dnf install epel-release 52$ dnf --enablerepo=powertools install bash clang libbpf-devel 53optional: 54$ dnf install bpftool 55Note: bin/src/runqslower.bpf.c requires a vmlinux.h generated from kernel 5.14+ 56 57