ftrace_hash_move(9)
π ftrace_hash_move(9) π
okay so bestie, welcome to the Kernel API Manual β¨ this one is all about moving a new hash into a filter and doing the little updates that go with it. stay with me, it's actually iconic π
πΈ NAME πΈ
ftrace_hash_move β move a new hash to a filter and do updates π
β¨ SYNOPSIS β¨
int ftrace_hash_move (struct ftrace_ops *ops , int enable , struct ftrace_hash **dst , struct ftrace_hash *src );
π¦ ARGUMENTS π¦
opsβ the ops that owns the hashdstis pointing at π«Άenableβtrueif we're talking about the filter hash,falseif it's the notrace hash. very binary of it πdstβ points to the ops hash that should get updated πsrcβ the hash we're updatingdstwith, main character energy fr fr π
π§ DESCRIPTION π§
so this gets called when an ftrace_ops hash is being updated and the kernel needs to reflect that. tiny important note: it only updates the kernel function callbacks if the ops is enabled β and no, don't confuse that with the enable argument above, they're different things π (iykyk). if the ops is enabled, its hash is what determines which callbacks get called. and this function is what runs when the ops hash gets updated and it needs new callbacks.
on success, the elements of src get moved to dst, and dst gets updated properly, and the functions determined by the ops hashes are now calling the ops callback function. slay. π
regardless of return type,srcshould be freed withfree_ftrace_hashβ no cap, do not skip this one π
π SEE ALSO π
kernel file ./kernel/trace/ftrace.c, plus literally this whole squad:
ftrace_lookup_ip(9)ftrace_free_filter(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)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)
that's the whole page bestie, go forth and move those hashes π«Ά
source: ./kernel/trace Β· version date: October 2026 Β· mwah, love u, bye ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms