Skip to content

Commit a828abb

Browse files
arndbAlexei Starovoitov
authored andcommitted
bpf: make bpf_session_is_return() reference optional
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. Fixes: 8fe4dc4 ("bpf: change prototype of bpf_session_{cookie,is_return}") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20260515113242.2706303-1-arnd@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 5939801 commit a828abb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kernel/bpf/verifier.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11263,7 +11263,11 @@ BTF_ID(func, bpf_task_work_schedule_resume)
1126311263
BTF_ID(func, bpf_arena_alloc_pages)
1126411264
BTF_ID(func, bpf_arena_free_pages)
1126511265
BTF_ID(func, bpf_arena_reserve_pages)
11266+
#ifdef CONFIG_BPF_EVENTS
1126611267
BTF_ID(func, bpf_session_is_return)
11268+
#else
11269+
BTF_ID_UNUSED
11270+
#endif
1126711271
BTF_ID(func, bpf_stream_vprintk)
1126811272
BTF_ID(func, bpf_stream_print_stack)
1126911273

0 commit comments

Comments
 (0)