public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bpf: mark get_entry_ip as __maybe_unused
@ 2022-11-03 15:03 Jonas Rabenstein
  2022-11-03 15:32 ` Jonas Rabenstein
  0 siblings, 1 reply; 7+ messages in thread
From: Jonas Rabenstein @ 2022-11-03 15:03 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Jonas Rabenstein, Song Liu, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Steven Rostedt,
	Masami Hiramatsu, bpf, linux-kernel

Commit c09eb2e578eb1668bbc ("bpf: Adjust kprobe_multi entry_ip
for CONFIG_X86_KERNEL_IBT") introduced the get_entry_ip() function.
Depending on CONFIG_X86_KERNEL_IBT it is a static function or only
a macro definition. The only user of this symbol so far is in
kprobe_multi_link_handler() if CONFIG_FPROBE is enabled.
If CONFIG_FROBE is not set, the symbol is not used and - depending
on CONFIG_X86_KERNEL_IBT - a warning for get_entry_ip() is emitted.
To solve this, the function should be marked as __maybe_unused.

Signed-off-by: Jonas Rabenstein <rabenstein@cs.fau.de>
---
 kernel/trace/bpf_trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index f2d8d070d024..19131aae0bc3 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -1032,7 +1032,7 @@ static const struct bpf_func_proto bpf_get_func_ip_proto_tracing = {
 };
 
 #ifdef CONFIG_X86_KERNEL_IBT
-static unsigned long get_entry_ip(unsigned long fentry_ip)
+static unsigned long __maybe_unused get_entry_ip(unsigned long fentry_ip)
 {
 	u32 instr;
 
-- 
2.37.4


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

end of thread, other threads:[~2022-11-07  9:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-03 15:03 [PATCH] bpf: mark get_entry_ip as __maybe_unused Jonas Rabenstein
2022-11-03 15:32 ` Jonas Rabenstein
2022-11-04 23:03   ` Daniel Borkmann
2022-11-07  8:56   ` Greg KH
2022-11-07  9:29     ` Greg KH
2022-11-07  9:48       ` Jonas Rabenstein
2022-11-07  9:51         ` Greg KH

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