Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bpf: allow kfuncs within tracepoint and perf event programs

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>

authored by

JP Kobryn and committed by
Alexei Starovoitov
bc638d8c 2db2b8cb

+2
+2
kernel/bpf/btf.c
··· 8357 8357 case BPF_PROG_TYPE_STRUCT_OPS: 8358 8358 return BTF_KFUNC_HOOK_STRUCT_OPS; 8359 8359 case BPF_PROG_TYPE_TRACING: 8360 + case BPF_PROG_TYPE_TRACEPOINT: 8361 + case BPF_PROG_TYPE_PERF_EVENT: 8360 8362 case BPF_PROG_TYPE_LSM: 8361 8363 return BTF_KFUNC_HOOK_TRACING; 8362 8364 case BPF_PROG_TYPE_SYSCALL: