The bpf_session_cookie is unavailable for !CONFIG_FPROBE as reported by Sebastian [1]. Instead of adding more ifdefs, making the session kfuncs globally available as suggested by Alexei. It's still allowed only for session programs, but it won't fail the build. [1] https://lore.kernel.org/bpf/20240531071557.MvfIqkn7@xxxxxxxxxxxxx/T/#m71c6d5ec71db2967288cb79acedc15cc5dbfeec5 Reported-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Suggested-by: Alexei Starovoitov <ast@xxxxxxxxxx> Fixes: 5c919acef8514 ("bpf: Add support for kprobe session cookie") Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx> --- kernel/trace/bpf_trace.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index f5154c051d2c..cc90d56732eb 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -3519,7 +3519,6 @@ static u64 bpf_uprobe_multi_entry_ip(struct bpf_run_ctx *ctx) } #endif /* CONFIG_UPROBES */ -#ifdef CONFIG_FPROBE __bpf_kfunc_start_defs(); __bpf_kfunc bool bpf_session_is_return(void) @@ -3568,4 +3567,3 @@ static int __init bpf_kprobe_multi_kfuncs_init(void) } late_initcall(bpf_kprobe_multi_kfuncs_init); -#endif -- 2.45.1