Commit a828abbb authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Alexei Starovoitov
Browse files

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: 8fe4dc4f ("bpf: change prototype of bpf_session_{cookie,is_return}")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20260515113242.2706303-1-arnd@kernel.org


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 59398017
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -11263,7 +11263,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)