ftrace_lookup_symbols(9)
π ftrace_lookup_symbols(9) β a Kernel API Manual moment
okay so bestie, welcome to the glow-up of ftrace_lookup_symbols(9), straight out of the Kernel API Manual β¨ this one's a little resolver function and honestly? she's kind of iconic π
πΈ NAME πΈ
ftrace_lookup_symbols β Lookup addresses for array of symbols π
β¨ SYNOPSIS β¨
int ftrace_lookup_symbols (const char **sorted_syms , size_t cnt ,
unsigned long *addrs );
π¦ ARGUMENTS π¦
sorted_symsβ array of symbols pointers, aka the symbols you want resolved. and listen, they must be alphabetically sorted, no cap π€cntβ number of symbols/addresses in thesyms/addrsarrays π’addrsβ array for storing the resulting addresses, that's her whole job π
π DESCRIPTION π
so what she does is: this function looks up addresses for the array of symbols you hand her in the syms array (and yes, it must be alphabetically sorted, i'm serious π) and then stores them all in the addrs array β which needs to be big enough to hold at least cnt addresses. big enough bestie, don't skimp π«Ά
for a single symbol (cnt == 1), she uses kallsyms_lookup_name, which performs an O(log N) binary search via the sorted kallsyms index. that's the fast lane, no full O(N) linear scan over all kernel symbols like the multi-symbol path has to do. she's efficient and she knows it π
for multiple symbols, she uses a single-pass linear scan via kallsyms_on_each_symbol with binary search into the sorted input array. slay, one pass, we love to see it β
π₯ RETURN π₯
0 if all provided symbols are found π β -ESRCH otherwise π
π SEE ALSO π
Kernel file ./kernel/trace/ftrace.c, plus the whole friend group:
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),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)
and that's the whole page, bestie π§π she lives in ./kernel/trace, this edition is dated October 2026, and she goes by ftrace_lookup_symbols(9) β periodt π
π
π¦ 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