bpf: make bpf_session_is_return() reference optional
PATCH v2 1/1 bpf: make bpf_session_is_return() reference optional
From: Arnd Bergmann <[email protected]>
Building without CONFIG_BPF_EVENTS produces a build-time warning:
WARN: resolve_btfids: unresolved symbol bpf_session_is_return
The function is actually defined in kernel/trace/bpf_trace.o, which is built conditionally based on configuration.
Make the reference to this function conditional as well, as is already done in the bpf verifier for other functions.
---
v2: fix patch title
--- kernel/bpf/verifier.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/bpf/verifier.c +4 -0
@@ -10882,7 +10882,11 @@ BTF_ID(func, bpf_task_work_schedule_resume) BTF_ID(func, bpf_arena_alloc_pages) BTF_ID(func, bpf_arena_free_pages) BTF_ID(func, bpf_arena_reserve_pages) +#ifdef CONFIG_BPF_EVENTS BTF_ID(func, bpf_session_is_return) +#else +BTF_ID_UNUSED +#endif BTF_ID(func, bpf_stream_vprintk) BTF_ID(func, bpf_stream_print_stack)
Signature · 1 line
2.39.5
This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <[email protected]>:
Quoted 8 lines · On Fri, 15 May 2026 13:32:32 +0200 you wrote:
From: Arnd Bergmann <[email protected]>
Building without
CONFIG_BPF_EVENTSproduces a build-time warning:WARN:
resolve_btfids: unresolved symbolbpf_session_is_return[...]
Here is the summary with links:
- [v2] bpf: make bpf_session_is_return() reference optional
https://git.kernel.org/bpf/bpf/c/a828abbb8976
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html