Subject: [tip: perf/core] perf/bpf: Mark perf_event_set_bpf_handler() and perf_event_free_bpf_handler() as inline too

The following commit has been merged into the perf/core branch of tip:

Commit-ID: 854dd99b5ddc9d90e31e5f112462a5994dd31810
Gitweb: https://git.kernel.org/tip/854dd99b5ddc9d90e31e5f112462a5994dd31810
Author: Ingo Molnar <[email protected]>
AuthorDate: Sun, 14 Apr 2024 22:33:27 +02:00
Committer: Ingo Molnar <[email protected]>
CommitterDate: Sun, 14 Apr 2024 22:35:26 +02:00

perf/bpf: Mark perf_event_set_bpf_handler() and perf_event_free_bpf_handler() as inline too

They can be unused with certain Kconfig variations:

kernel/events/core.c:9622:13: warning: ‘perf_event_free_bpf_handler’ defined but not used [-Wunused-function]
kernel/events/core.c:9586:12: warning: ‘perf_event_set_bpf_handler’ defined but not used [-Wunused-function]

Since they are both single-use, mark them inline.

Signed-off-by: Ingo Molnar <[email protected]>
Cc: [email protected]
Cc: Kyle Huey <[email protected]>
---
kernel/events/core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index da9d9a1..6b0a66e 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -9583,9 +9583,9 @@ out:
return ret;
}

-static int perf_event_set_bpf_handler(struct perf_event *event,
- struct bpf_prog *prog,
- u64 bpf_cookie)
+static inline int perf_event_set_bpf_handler(struct perf_event *event,
+ struct bpf_prog *prog,
+ u64 bpf_cookie)
{
if (event->overflow_handler_context)
/* hw breakpoint or kernel counter */
@@ -9619,7 +9619,7 @@ static int perf_event_set_bpf_handler(struct perf_event *event,
return 0;
}

-static void perf_event_free_bpf_handler(struct perf_event *event)
+static inline void perf_event_free_bpf_handler(struct perf_event *event)
{
struct bpf_prog *prog = event->prog;