[openwrt/openwrt] build: add option KERNEL_DEBUG_INFO_BTF
LEDE Commits
lede-commits at lists.infradead.org
Wed May 18 04:32:50 PDT 2022
stintel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/531e0399cd7fca9e1a88520b817ac036da204c1c
commit 531e0399cd7fca9e1a88520b817ac036da204c1c
Author: Tony Ambardar <itugrok at yahoo.com>
AuthorDate: Sun Jul 26 07:51:34 2020 -0700
build: add option KERNEL_DEBUG_INFO_BTF
Generate BTF (BPF Type Format) information from DWARF debug info. This is
embedded in the kernel and exported via sysfs as /sys/kernel/btf/vmlinux.
BTF data enhances kernel portability and introspection for BPF programs.
Selecting this also enables the dwarves host package which provides the
pahole tool used for BTF encoding.
Test using: "bpftool btf dump file /sys/kernel/btf/vmlinux format c"
This needs to depend on KERNEL_DEBUG_INFO_REDUCED not being set,
otherwise we can enable both KERNEL_DEBUG_INFO_BTF and
KERNEL_DEBUG_INFO_REDUCED, which will result in undefined behaviour.
Signed-off-by: Tony Ambardar <itugrok at yahoo.com>
Signed-off-by: Felix Fietkau <nbd at nbd.name>
[split DEBUG_INFO_REDUCED into separate commit, add dependency]
Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
config/Config-kernel.in | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index e146107148..1a3f6a8bdc 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -373,6 +373,20 @@ config KERNEL_DEBUG_INFO
help
This will compile your kernel and modules with debug information.
+config KERNEL_DEBUG_INFO_BTF
+
+ bool "Enable additional BTF type information"
+ default n
+ depends on !HOST_OS_MACOS
+ depends on KERNEL_DEBUG_INFO && !KERNEL_DEBUG_INFO_REDUCED
+ select DWARVES
+ help
+ Generate BPF Type Format (BTF) information from DWARF debug info.
+ Turning this on expects presence of pahole tool, which will convert
+ DWARF type info into equivalent deduplicated BTF type info.
+
+ Required to run BPF CO-RE applications.
+
config KERNEL_DEBUG_INFO_REDUCED
bool "Reduce debugging information"
default y
More information about the lede-commits
mailing list