]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bpf: flatten bpf_probe_register call chain
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 19 Mar 2024 23:38:48 +0000 (16:38 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 20 Mar 2024 06:05:33 +0000 (23:05 -0700)
bpf_probe_register() and __bpf_probe_register() have identical
signatures and bpf_probe_register() just redirect to
__bpf_probe_register(). So get rid of this extra function call step to
simplify following the source code.

It has no difference at runtime due to inlining, of course.

Acked-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Message-ID: <20240319233852.1977493-2-andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/trace/bpf_trace.c

index 1b041911b1d8c99dfbf9c3c901e34af8489de0cf..30ecf62f8a177c4c3bb8cc6d31e47fcf5d472b32 100644 (file)
@@ -2425,7 +2425,7 @@ BPF_TRACE_DEFN_x(10);
 BPF_TRACE_DEFN_x(11);
 BPF_TRACE_DEFN_x(12);
 
-static int __bpf_probe_register(struct bpf_raw_event_map *btp, struct bpf_prog *prog)
+int bpf_probe_register(struct bpf_raw_event_map *btp, struct bpf_prog *prog)
 {
        struct tracepoint *tp = btp->tp;
 
@@ -2443,11 +2443,6 @@ static int __bpf_probe_register(struct bpf_raw_event_map *btp, struct bpf_prog *
                                                   prog);
 }
 
-int bpf_probe_register(struct bpf_raw_event_map *btp, struct bpf_prog *prog)
-{
-       return __bpf_probe_register(btp, prog);
-}
-
 int bpf_probe_unregister(struct bpf_raw_event_map *btp, struct bpf_prog *prog)
 {
        return tracepoint_probe_unregister(btp->tp, (void *)btp->bpf_func, prog);