modify_ftrace_direct_nolock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… modify_ftrace_direct_nolock(9) β€” Kernel API Manual, section 9 πŸŽ€

okay so bestie, welcome to the funkiest little corner of the Kernel API Manual (that's section 9, iykyk) β€” the one and only modify_ftrace_direct_nolock. yes the name is a mouthful. no we are not changing it. let's get into it ✨


🌸 NAME 🌸

modify_ftrace_direct_nolock β€” literally goes in and changes an existing direct 'multi' call so it calls something else instead. glow-up szn for your trampolines πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int modify_ftrace_direct_nolock (struct ftrace_ops *ops , unsigned long
addr );

like, that's the whole summoning ritual. two args, one int back. slay 🫢


⭐ ARGUMENTS ⭐

  • ops β€” the address of the struct ftrace_ops object. yes, the address. hand over the pointer bestie, not a copy πŸ™ˆ
  • addr β€” the address of the new trampoline that's gonna get called at ops functions. new main character energy, fr fr πŸ”₯

πŸ‘‘ DESCRIPTION πŸ‘‘

So what's the whole vibe? This function is used to unregister the direct caller that's currently registered and register the new one, addr, on the functions registered in the ops object. out with the old, in with the new, no cap πŸ’–

⚠️ heads up bestie: there's a window between the ftrace_shutdown and ftrace_startup calls where no callbacks get called at all. like, a little gap in the group chat where nobody's typing. it's real and it's documented 😭

And because this is the nolock version (the name is a spoiler, iconic), the caller should already have direct_mutex locked β€” so we don't lock direct_mutex here. you gotta come prepared, girlie. no double-locking in this house πŸš«πŸ”’


🌈 RETURN 🌈

  • zero on success πŸŽ‰ periodt
  • Non zero on error, which includes:
    • -EINVAL β€” the ops object was not properly registered. πŸ’€ rude, but fair

🧚 SEE ALSO 🧚

all the siblings, cousins, and distant relatives in ./kernel/trace/ftrace.c β€” say hi to the whole family πŸ’œ:

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(9), hash_add(9), update_ftrace_direct_add(9), hash_sub(9), update_ftrace_direct_del(9), update_ftrace_direct_mod(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)


πŸ“ sign-off πŸ“

okay that's the whole page!! this icon lives in ./kernel/trace, and it was dated October 2026 β€” which, yes, is in the future, and yes, she's ahead of her time πŸ’…βœ¨ mwah, go forth and modify those direct calls responsibly πŸ¦‹

πŸ“¦ where this page comes from