On Tue, 23 Sep 2025 23:51:40 +0200 Jiri Olsa <[email protected]> wrote:
> Adding register_ftrace_direct_hash function that registers > all entries (ip -> direct) provided in hash argument. > > The difference to current register_ftrace_direct is > - hash argument that allows to register multiple ip -> direct > entries at once I'm a bit confused. How is this different? Doesn't register_ftrace_direct() register multiple ip -> direct entries at once too? But instead of using a passed in hash, it uses the hash from within the ftrace_ops. > - we can call register_ftrace_direct_hash 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 OK, I don't like the name "register" here. "register" should be for the first instance and then it is registered. If you call it multiple times on the same ops without "unregister" it should give an error. Perhaps call this "update_ftrace_direct()" where it can update a direct ftrace_ops from? > > This change will allow us to have simple ftrace_ops for all bpf > direct interface users in following changes. After applying all the patches, I have this: $ git grep register_ftrace_direct_hash include/linux/ftrace.h:int register_ftrace_direct_hash(struct ftrace_ops *ops, struct ftrace_hash *hash); include/linux/ftrace.h:int unregister_ftrace_direct_hash(struct ftrace_ops *ops, struct ftrace_hash *hash); include/linux/ftrace.h:int register_ftrace_direct_hash(struct ftrace_ops *ops, struct ftrace_hash *hash) include/linux/ftrace.h:int unregister_ftrace_direct_hash(struct ftrace_ops *ops, struct ftrace_hash *hash) kernel/trace/ftrace.c: err = register_ftrace_direct_hash(ops, hash); kernel/trace/ftrace.c: err = unregister_ftrace_direct_hash(ops, hash); kernel/trace/ftrace.c:int register_ftrace_direct_hash(struct ftrace_ops *ops, struct ftrace_hash *hash) kernel/trace/ftrace.c:EXPORT_SYMBOL_GPL(register_ftrace_direct_hash); kernel/trace/ftrace.c:int unregister_ftrace_direct_hash(struct ftrace_ops *ops, struct ftrace_hash *hash) kernel/trace/ftrace.c:EXPORT_SYMBOL_GPL(unregister_ftrace_direct_hash); Where I do not see it is used outside of ftrace.c. Why is it exported? -- Steve
