]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bpf: allow kfuncs within tracepoint and perf event programs
authorJP Kobryn <inwardvessel@gmail.com>
Thu, 5 Sep 2024 22:38:11 +0000 (15:38 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 6 Sep 2024 00:02:03 +0000 (17:02 -0700)
Associate tracepoint and perf event program types with the kfunc tracing
hook. This allows calling kfuncs within these types of programs.

Signed-off-by: JP Kobryn <inwardvessel@gmail.com>
Link: https://lore.kernel.org/r/20240905223812.141857-2-inwardvessel@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/btf.c

index 1e29281653c62f9e2fbc9879c127cdc0561bf957..59b4f7265761c954808b6969f715f9ec01fac125 100644 (file)
@@ -8357,6 +8357,8 @@ static int bpf_prog_type_to_kfunc_hook(enum bpf_prog_type prog_type)
        case BPF_PROG_TYPE_STRUCT_OPS:
                return BTF_KFUNC_HOOK_STRUCT_OPS;
        case BPF_PROG_TYPE_TRACING:
+       case BPF_PROG_TYPE_TRACEPOINT:
+       case BPF_PROG_TYPE_PERF_EVENT:
        case BPF_PROG_TYPE_LSM:
                return BTF_KFUNC_HOOK_TRACING;
        case BPF_PROG_TYPE_SYSCALL: