sprint_backtrace(9)
π 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 π«Ά
- Kernel file
./kernel/kallsyms.c sprint_symbol(9)sprint_symbol_build_id(9)sprint_symbol_no_offset(9)sprint_backtrace_build_id(9)
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
- 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