Distro versions and BTF support #713
Replies: 2 comments 9 replies
-
Hello Grant, Ubuntu kernels are providing BTF debug info support (through sysfs) from Ubuntu Groovy and on. For the HWE kernels (Groovy kernel running on Focal or Bionic), they do support CONFIG_DEBUG_INFO_BTF but don't have config option enabled because link-vmlinux.sh - from kernel tree - uses pahole (from dwarves package) and it needs to be recent to support BTF (not available before Groovy in Ubuntu userland set of packages). Canonical kernel kernel team has disabled BTF support for HWE kernels for Bionic and Focal because builders don't have recent pahole binary. That explains why I'm packaging ELF files containing BTF section only for Focal and Bionic in my project (conntracker) at: It is not perfect but, by having always the latest kernel vmlinux BTF section available, you can almost all the times run same code even in previous minor versions. For Bionic I have a BTF file for 4.15.x and another for 5.4.x... for Focal I have a BTF file for 5.4.x and 5.8.x. By stripping the ELF files with the BTF sections you will usually end up with a ~3MB ELF file containing the BTF info. I usually use the procedure at: https://github.com/rafaeldtinoco/portablebpf/#portable-libbpf-based-ebpf-code-older-kernels. This is how I made conntracker CO.RE in Ubuntu =) ... + the following patches: https://github.com/rafaeldtinoco/portablebpf/blob/master/patches/libbpf-introduce-legacy-kprobe-events-support.patch and the upstream commit:
that allows eBPF code to bypass eBPF ELF attribute version checks in older kernels (like v4.15), as showed in: LINKS: |
Beta Was this translation helpful? Give feedback.
-
Here's a list of BTF enabled distros from libbpf readme on GitHub: https://github.com/libbpf/libbpf#bpf-co-re-compile-once--run-everywhere
|
Beta Was this translation helpful? Give feedback.
-
I couldn't find a central source of truth for which LTS distro releases have had BTF backported to them but went through some of the big ones manually using vagrant:
Ubuntu 14.04 - linux 3.13 - no ebpf support
Ubuntu 16.04 - linux 4.4.0 - ebpf, no BTF
Ubuntu 18.04 - linux 4.15. - ebpf, no BTF
Ubuntu 20.04 - linux 5.4 - BTF is supported in kernel, but CONFIG_DEBUG_INFO_BTF is not set
Ubuntu 20.10 - linux 5.8 - BTF enabled
Centos 7 - linux 3.10 - ebpf yes, no BTF support
Centos 8 - linux 4.18 - BTF supported and enabled
Debian 10 - linux 4.19 - No BTF support
Based on this we can't only support tracee CO:RE, and compiling against various kernel headers for releases would still be very helpful.
Beta Was this translation helpful? Give feedback.
All reactions