summaryrefslogtreecommitdiff
path: root/scripts/package/kernel.spec
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2026-10-11 14:18:07 +0000
committerAlexei Starovoitov <ast@kernel.org>2026-10-11 14:18:07 +0000
commitac1dff2daebb04816766106740042e7ad92859dd (patch)
treeabdf06d1a35a148b690237a4390acf81d764c718 /scripts/package/kernel.spec
parent4411c854408c05f083c828b69e72e3cc22384fbf (diff)
parent400f0881c912af87091973f231c1b573c2b24292 (diff)
Merge branch 'kbuild-bpf-support-inline-info-in-btf'
Alan Maguire says: ==================== kbuild, bpf: Support inline info in BTF If CONFIG_DEBUG_INFO_BTF_INLINE=y|m, add the "inline" BTF feature and encode inline site info in BTF alongside standard BTF data. resolve_btfids will then partition into non- and inline-related info and split BTF will be used to store inline info in a .BTF.inline section in vmlinux and modules. For CONFIG_DEBUG_INFO_BTF=m, vmlinux inline info will be stored in btf_vmlinux_inline.ko and will be loaded on-demand if used via /sys/kernel/btf/vmlinux.inline. A .BTF.inline.link section in vmlinux stores the module name, the SHA of the BTF and the size so that even without loading the kernel can size the sysfs representation correctly. This approach is based on [1] and the .BTF.inline.link section is modeled on .GNU_debuglink. Because a module can be built with .BTF.base to allow for BTF relocation, its inline info needs to be relocated also so a bit more work needs to be done to handle this. Patches 1, 2 add resolve_btfids support to partition BTF into .BTF and .BTF.inline and to support populating a BTF link section for BTF_INLINE=m. Patch 3 handles vmlinux.inline exposure in sysfs. Patch 4 does prep work for relocation needed in patch 5 prior to exposing relocated BTF in sysfs, and patches 6 and 7 test BTF sysfs representations and inline validity using bpf_testmod respectively. To generate inline info the latest pahole is needed [2]. Inline info for vmlinux can be quite large ~10Mb for over 600,000 inline sites in the kernel, so CONFIG_DEBUG_INFO_BTF_INLINE=m is recommended; this brings the on-disk size down below 4Mb for a gzip-compressed btf_vmlinux_inline.ko. Changes since v3 [3]: - Retain original BTF in resolve_btfids and be careful about free order (bots, patch 1) - Add more failure diagnostics to patching of BTF links (bots, patch 2) - Guard vmallocs for zero-sized inline data (bots, patch 3) - Fix potential NULL pointer BTF deref (bots, patch 5) - Fix up leaks in sysfs test (bots, patch 6) - Fix up tests to use kallsyms lookup directly, and improve validation of location info (bots, patch 7) Changes since v2 [4] - Delivered the libbpf, bpftool parts are prerequisites - Switched to using Eduard's neater BTF partitioning approach which is fully in resolve_btfids instead of libbpf (Eduard, patch 1) - Supports mmap()ed vmlinux.inline (Alexei, patch 3, test patch 7) - Moved to using .BTF.inline.link to store inline BTF size which avoids need to switch to using kernfs; also allows us to SHA-verify BTF inline info [1] https://lore.kernel.org/bpf/20260925224229.1850-1-wanjay@amazon.com/ [2] https://git.kernel.org/pub/scm/devel/pahole/pahole.git/ [3] https://lore.kernel.org/bpf/20261003194323.817885-1-alan.maguire@oracle.com/ [4] https://lore.kernel.org/bpf/20260901165757.801449-1-alan.maguire@oracle.com/ ==================== Link: https://patch.msgid.link/20261009112324.1442319-1-alan.maguire@oracle.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'scripts/package/kernel.spec')
-rw-r--r--scripts/package/kernel.spec10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
index 46e80970f723..8f0933cbbe45 100644
--- a/scripts/package/kernel.spec
+++ b/scripts/package/kernel.spec
@@ -68,13 +68,13 @@ This package provides debug information for the kernel image and modules from th
%undefine _debugsource_packages
%undefine _debuginfo_subpackages
-# Preserve .BTF and .BTF.base sections in kernel modules during debuginfo
-# stripping. find-debuginfo.sh uses eu-strip which removes non-allocated ELF
-# sections like .BTF by default. .BTF.base is required for BTF distillation
-# support; without it, module BTF validation fails.
+# Preserve .BTF, .BTF.base and .BTF.inline sections in kernel modules during
+# debuginfo stripping. find-debuginfo.sh uses eu-strip which removes
+# non-allocated ELF sections like .BTF by default. .BTF.base is required for
+# BTF distillation support; without it, module BTF validation fails.
%global with_keep_section %(%{__find_debuginfo} --help 2>&1 | grep -c keep-section)
%if %{with_keep_section}
-%global _find_debuginfo_opts -r --keep-section .BTF --keep-section .BTF.base
+%global _find_debuginfo_opts -r --keep-section .BTF --keep-section .BTF.base --keep-section .BTF.inline
%else
%global _find_debuginfo_opts -r
%endif