update_ftrace_direct_mod(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… update_ftrace_direct_mod β€” the kernel API manual, bestie edition ✨

okay so you found your way into the update_ftrace_direct_mod(9) page of the Kernel API Manual and honestly? iconic of you. pull up a chair πŸŽ€


✨ NAME ✨

update_ftrace_direct_mod β€” updates @ops by modifing its direct callers provided in @hash

(yes bestie, "modifing" is literally how it's spelled in the original, we do not touch the lore πŸ’€)


🌸 SYNOPSIS 🌸

int update_ftrace_direct_mod (struct ftrace_ops *ops , struct
       ftrace_hash *hash , bool do_direct_lock );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • ops β€” the address of the struct ftrace_ops object, bestie. that's the whole vibe of this arg.
  • hash β€” the address of the struct ftrace_hash object. also just an address. slay.
  • do_direct_lock β€” if true, lock the direct_mutex. that's it, that's the whole job 🫢

πŸ’– DESCRIPTION πŸ’–

so this one is used to modify custom direct callers (ip -> addr) in ops, specified via hash. no cap, that's the entire point of it ✨

and here's the part you actually need to remember, bestie: this can be called from within the ftrace ops_func callback with direct_mutex already locked β€” and in that case do_direct_lock needs to be false. like, false false. do not double-lock, it's giving chaos 😭


πŸ”₯ RETURN πŸ”₯

zero on success πŸŽ‰ non zero on error, which includes:

  • -EINVAL β€” the hash is empty πŸ™ˆ
  • -EINVAL β€” the ops is not registered πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./kernel/trace/ftrace.c β€” and like, all of these besties:

ftrace_lookup_ip(9), ftrace_free_filter(9), ftrace_hash_move(9), ftrace_location_range(9), ftrace_location(9), ftrace_text_reserved(9), ftrace_bug(9), ftrace_update_record(9), ftrace_test_record(9), ftrace_get_addr_new(9), ftrace_get_addr_curr(9), ftrace_rec_iter_start(9), ftrace_rec_iter_next(9), ftrace_rec_iter_record(9), ftrace_run_stop_machine(9), arch_ftrace_update_code(9), ftrace_startup_subops(9), ftrace_shutdown_subops(9), ftrace_regex_open(9), allocate_ftrace_func_mapper(9), ftrace_func_mapper_find_ip(9), ftrace_func_mapper_add_ip(9), ftrace_func_mapper_remove_ip(9), free_ftrace_func_mapper(9), register_ftrace_direct(9), unregister_ftrace_direct(9), modify_ftrace_direct_nolock(9), modify_ftrace_direct(9), hash_add(9), update_ftrace_direct_add(9), hash_sub(9), update_ftrace_direct_del(9), ftrace_set_filter_ip(9), ftrace_set_filter_ips(9), ftrace_ops_set_global_filter(9), ftrace_set_filter(9), ftrace_set_notrace(9), ftrace_set_global_filter(9), ftrace_set_global_notrace(9), ftrace_ops_get_func(9), ftrace_kill(9), ftrace_is_dead(9), register_ftrace_function(9), unregister_ftrace_function(9), ftrace_lookup_symbols(9)

like, read them all. iykyk πŸ’œ


and that's the page, bestie 🧚 this lil gem lives in ./kernel/trace, dated October 2026, and it's update_ftrace_direct_mod(9) all the way down β€” go forth and modify those direct callers responsibly, mwah πŸ’…πŸ’–

πŸ“¦ where this page comes from