]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf,x86: Use single ftrace_ops for direct calls
authorJiri Olsa <jolsa@kernel.org>
Tue, 30 Dec 2025 14:50:10 +0000 (15:50 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 28 Jan 2026 19:44:59 +0000 (11:44 -0800)
commit424f6a3610965d125634bc65c5d6d506582d4f7e
tree2515d6389f15eaa4d760ca44c43fa5ac3a486b99
parent956747efd82aa60e0ac3e6aef2b9a17adda6f3b1
bpf,x86: Use single ftrace_ops for direct calls

Using single ftrace_ops for direct calls update instead of allocating
ftrace_ops object for each trampoline.

With single ftrace_ops object we can use update_ftrace_direct_* api
that allows multiple ip sites updates on single ftrace_ops object.

Adding HAVE_SINGLE_FTRACE_DIRECT_OPS config option to be enabled on
each arch that supports this.

At the moment we can enable this only on x86 arch, because arm relies
on ftrace_ops object representing just single trampoline image (stored
in ftrace_ops::direct_call). Archs that do not support this will continue
to use *_ftrace_direct api.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://lore.kernel.org/bpf/20251230145010.103439-10-jolsa@kernel.org
arch/x86/Kconfig
kernel/bpf/trampoline.c
kernel/trace/Kconfig
kernel/trace/ftrace.c