FS#66260 - [linux] Add BTF support with config option CONFIG_DEBUG_INFO_BTF=y
Attached to Project:
Arch Linux
Opened by Sardelli Tommaso (cippaciong) - Tuesday, 14 April 2020, 21:03 GMT
Last edited by Jan Alexander Steffens (heftig) - Sunday, 07 June 2020, 13:51 GMT
Opened by Sardelli Tommaso (cippaciong) - Tuesday, 14 April 2020, 21:03 GMT
Last edited by Jan Alexander Steffens (heftig) - Sunday, 07 June 2020, 13:51 GMT
|
Details
Description:
The current version of the linux package already supports eBPF through the usual config options like CONFIG_BPF, CONFIG_BPF_SYSCALL, CONFIG_BPF_JIT, etc. However, there isn't any support for the more recent BTF (BPF Type Format), which allows BPF developers to have debug info from their eBPF programs. If possible, I would like to have BTF support added to the linux package with the additional config option CONFIG_DEBUG_INFO_BTF=y. More information about BTF can be found at [0], [1], and [2] Thank you all for your work :) [0] https://www.kernel.org/doc/html/latest/bpf/btf.html [1] https://facebookmicrosites.github.io/bpf/blog/2018/11/14/btf-enhancement.html [2] https://facebookmicrosites.github.io/bpf/blog/2020/02/19/bpf-portability-and-co-re.html#btf |
This task depends upon
Closed by Jan Alexander Steffens (heftig)
Sunday, 07 June 2020, 13:51 GMT
Reason for closing: Implemented
Additional comments about closing: linux 5.7.1.arch1-1
Sunday, 07 June 2020, 13:51 GMT
Reason for closing: Implemented
Additional comments about closing: linux 5.7.1.arch1-1
To clarify, this also allows BPF developers have access to _kernel_ debug information. It's much less heavy weight than DWARF (~1.5MB for BTF).
BTF enables all sorts of powerful features in bpftrace[0].
[0]: https://github.com/iovisor/bpftrace/blob/master/docs/reference_guide.md#15-kfunckretfunc-kernel-functions-tracing
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_REDUCED=y
CONFIG_DEBUG_INFO_SPLIT=y
# CONFIG_DEBUG_INFO_DWARF4 is not set
CONFIG_DEBUG_INFO_BTF=y
(compiled against upstream master)
-rwxr-xr-x 1 daniel daniel 150M Apr 25 15:21 vmlinux
Not sure how to build arch kernel. Never tried. This is just `make vmlinux` from the
linux source tree.
I've attached the build config. It's just the `zcat /prog/config.gz` with the above
options flipped to enable BTF.
That being said, I don't think arch should be shipping DWARF symbols -- too heavy.
Maybe build BTF and the strip out the debug symbols, leaving BTF intact.
$ ls -lh linux-5.7.arch1-2-x86_64.pkg.tar.xz
-rw-r--r-- 1 builder builder 72M Jun 4 12:28 linux-5.7.arch1-2-x86_64.pkg.tar.xz
(after booting that kernel)
$ ls /sys/kernel/btf
vmlinux