summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2025-12-30 15:50:05 +0100
committerAndrii Nakryiko <andrii@kernel.org>2026-01-28 11:44:48 -0800
commit05dc5e9c1fe156fd9dddc4c2f81e8fc6c7e50eb5 (patch)
treeee389576f04b6382c2d1b42c755020d2d4f81c1e /include/linux
parent0e860d07c29d70205d5ad48456ac7a133ccfb293 (diff)
ftrace: Add update_ftrace_direct_add function
Adding update_ftrace_direct_add function that adds all entries (ip -> addr) provided in hash argument to direct ftrace ops and updates its attachments. The difference to current register_ftrace_direct is - hash argument that allows to register multiple ip -> direct entries at once - we can call update_ftrace_direct_add multiple times on the same ftrace_ops object, becase after first registration with register_ftrace_function_nolock, it uses ftrace_update_ops to update the ftrace_ops object This change will allow us to have simple ftrace_ops for all bpf direct interface users in following changes. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Link: https://lore.kernel.org/bpf/20251230145010.103439-5-jolsa@kernel.org
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ftrace.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index a77b57a4aba2..43a6cfaf5aae 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -543,6 +543,8 @@ int unregister_ftrace_direct(struct ftrace_ops *ops, unsigned long addr,
int modify_ftrace_direct(struct ftrace_ops *ops, unsigned long addr);
int modify_ftrace_direct_nolock(struct ftrace_ops *ops, unsigned long addr);
+int update_ftrace_direct_add(struct ftrace_ops *ops, struct ftrace_hash *hash);
+
void ftrace_stub_direct_tramp(void);
#else
@@ -569,6 +571,11 @@ static inline int modify_ftrace_direct_nolock(struct ftrace_ops *ops, unsigned l
return -ENODEV;
}
+static inline int update_ftrace_direct_add(struct ftrace_ops *ops, struct ftrace_hash *hash)
+{
+ return -ENODEV;
+}
+
/*
* This must be implemented by the architecture.
* It is the way the ftrace direct_ops helper, when called