]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: Add struct bpf_trampoline_ops object
authorJiri Olsa <jolsa@kernel.org>
Sat, 6 Jun 2026 12:39:30 +0000 (14:39 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 7 Jun 2026 17:03:00 +0000 (10:03 -0700)
commit8a35e8db740f96ec17b85db5a0f83c028c707a3e
treeb6aa497fdda171aad043bcc596fcbfbef29d55bc
parente6abd4cd157bf63cd89c74f8f10abae76e7b0359
bpf: Add struct bpf_trampoline_ops object

In following changes we will need to override ftrace direct attachment
behaviour. In order to do that we are adding struct bpf_trampoline_ops
object that defines callbacks for ftrace direct attachment:

   register_fentry
   unregister_fentry
   modify_fentry

The new struct bpf_trampoline_ops object is passed as an argument to
__bpf_trampoline_link/unlink_prog functions.

At the moment the default trampoline_ops is set to the current ftrace
direct attachment functions, so there's no functional change for the
current code.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20260606123955.345967-6-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/trampoline.c