Re: [PATCH] bpf: make bpf_session_cookie() reference optional

From: Yonghong Song

Date: Tue May 19 2026 - 12:47:58 EST




On 5/15/26 2:06 AM, Arnd Bergmann wrote:
From: Arnd Bergmann <arnd@xxxxxxxx>

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: 8fe4dc4f6456 ("bpf: change prototype of bpf_session_{cookie,is_return}")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

LGTM exception in subject bpf_session_cookie() should be bpf_session_is_return().

Acked-by: Yonghong Song <yonghong.song@xxxxxxxxx>