sprint_backtrace(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sprint_backtrace(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” this is the tea on sprint_backtrace, and honestly? it's giving "small function, huge save" energy ✨


🌸 NAME 🌸

sprint_backtrace β€” looks up a backtrace symbol and hands it back to you in a text buffer πŸŽ€


✨ SYNOPSIS ✨

int sprint_backtrace (char *buffer , unsigned long address );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • buffer β€” the buffer where the stuff gets stored, bestie πŸ’–
  • address β€” the address you want to look up πŸ”

πŸ‘‘ DESCRIPTION πŸ‘‘

so this one is for stack backtrace, and it literally does the same thing as sprint_symbol… except with a modified/decreased address. no cap. πŸ™ˆ

here's the vibe: if there's a tail-call to a function marked "noreturn", gcc goes full optimized gremlin mode and optimizes out the code after the call, so the stack-saved return address could end up pointing outside of the caller 😭. not iconic of it, honestly.

that's exactly why this function exists β€” it decreases the address so that kallsyms can still find the original caller πŸ’… periodt.

and what does it give you back? the number of bytes stored in buffer. that's the return value, babes ✨


🫢 SEE ALSO 🫢

go read them, they're all part of the same friend group πŸ’œ


and that's the whole page, bestie!! 🧚 this little icon lives in ./kernel and the version stamp says October 2026 β€” mwah, slay, see you in the source πŸŒˆπŸ’–πŸŽ€

πŸ“¦ where this page comes from