kbuild, bpf: enable --btf_features=attributes
Ihor Solodrai
reviewerPATCH 1/1 kbuild, bpf: enable --btf_features=attributes
pahole v1.30 has a BTF encoding feature for arbitrary attributes, used in particular for tagging bpf_arena_alloc_pages and bpf_arena_free_pages BPF kfuncs [1][2].
Enable it for the kernel build.
[1] https://lore.kernel.org/bpf/[email protected]/
[2] https://lore.kernel.org/bpf/[email protected]/
--- scripts/Makefile.btf | 2 ++ 1 file changed, 2 insertions(+)
scripts/Makefile.btf +2 -0
@@ -23,6 +23,8 @@ else # Switch to using --btf_features for v1.26 and later. pahole-flags-$(call test-ge, $(pahole-ver), 126) = -j$(JOBS) --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs +pahole-flags-$(call test-ge, $(pahole-ver), 130) += --btf_features=attributes + ifneq ($(KBUILD_EXTMOD),) module-pahole-flags-$(call test-ge, $(pahole-ver), 128) += --btf_features=distilled_base endif
Signature · 1 line
2.49.0
Quoted 11 lines · Ihor Solodrai
pahole v1.30 has a BTF encoding feature for arbitrary attributes, used in particular for tagging
bpf_arena_alloc_pagesandbpf_arena_free_pagesBPF kfuncs [1][2].Enable it for the kernel build.
[1] https://lore.kernel.org/bpf/[email protected]/
[2] https://lore.kernel.org/bpf/[email protected]/Signed-off-by Ihor Solodrai <[email protected]>---
With this patch and a new pahole I see the following text in vmlinux.h:
... extern void __attribute__((address_space(1))) *bpf_arena_alloc_pages(void *p__map, void __attribute__((address_space(1))) *addr__ign, u32 page_cnt, int node_id, u64 flags) __weak __ksym; extern void bpf_arena_free_pages(void *p__map, void __attribute__((address_space(1))) *ptr__ign, u32 page_cnt) __weak __ksym; ...
test_progs are compiling and passing w/o issues.
[...]
This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:
Quoted 10 lines · On Mon, 14 Apr 2025 11:59:18 -0700 you wrote:
pahole v1.30 has a BTF encoding feature for arbitrary attributes, used in particular for tagging
bpf_arena_alloc_pagesandbpf_arena_free_pagesBPF kfuncs [1][2].Enable it for the kernel build.
[1] https://lore.kernel.org/bpf/[email protected]/
[2] https://lore.kernel.org/bpf/[email protected]/[...]
Here is the summary with links:
- [bpf-next] kbuild, bpf: enable --btf_features=attributes
https://git.kernel.org/bpf/bpf-next/c/21cb33c7e065
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html