ftrace_lookup_symbols(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the syms/addrs arrays πŸ”’
  • 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:


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