BPF List
 help / color / mirror / Atom feed
* [PATCH bpf] bpf: Make session kfuncs global
@ 2024-05-31 10:15 Jiri Olsa
  2024-05-31 10:39 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 7+ messages in thread
From: Jiri Olsa @ 2024-05-31 10:15 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: Sebastian Andrzej Siewior, bpf, Martin KaFai Lau, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
	Hao Luo

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@linutronix.de/T/#m71c6d5ec71db2967288cb79acedc15cc5dbfeec5
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Suggested-by: Alexei Starovoitov <ast@kernel.org>
Fixes: 5c919acef8514 ("bpf: Add support for kprobe session cookie")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-31 16:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-31 10:15 [PATCH bpf] bpf: Make session kfuncs global Jiri Olsa
2024-05-31 10:39 ` Sebastian Andrzej Siewior
2024-05-31 10:42   ` Jiri Olsa
2024-05-31 10:49     ` Sebastian Andrzej Siewior
2024-05-31 11:25       ` Jiri Olsa
2024-05-31 14:04         ` Sebastian Andrzej Siewior
2024-05-31 16:55           ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox