FUNCTION::SPRINT_UBA(3stap)

πŸ’– function::sprint_ubacktrace πŸ’–

okay so bestie, welcome to 3stap, the Context Functions chapter of the SystemTap tapset reference, and today's main character is sprint_ubacktrace β€” she returns a stack back trace for the current user-space task, as a string. periodt. πŸŽ€


✨ NAME ✨

function::sprint_ubacktrace β€” returns a stack back trace for the current user-space task, as a string. that's it, that's the whole gig, and she ate. πŸ’…


🌸 SYNOPSIS 🌸

sprint_ubacktrace:string()

πŸ¦‹ ARGUMENTS πŸ¦‹

  • None β€” literally nothing, zero, nada, no arguments, she needs no input to serve πŸ’œ

✨ DESCRIPTION ✨

So what she actually does: she returns a simple backtrace for the current task, one line per address. cute, tidy, iconic. 🌈

Each line includes:

  • the symbol name β€” or, if the symbol couldn't be resolved, the hex address instead (no cap, sometimes symbols just ghost you 😭)
  • the module name, if found
  • the offset from the start of the function, if found β€” otherwise that offset gets added to the module instead (and if the module was found, it goes between brackets) 🫢

She hands the whole backtrace back to you as a string, with each line terminated by a newline character. chef's kiss.

⚠️ heads up bestie: the returned stack is truncated to MAXSTRINGLEN. if you want fuller and richer stacks, go use print_ubacktrace instead. no cap.

Also worth knowing: she's equivalent to sprint_ustack(ubacktrace), except she's more efficient β€” because there's no need to translate between hex strings and the final backtrace string. lowkey a flex. πŸ’…


πŸ’€ NOTE πŸ’€

To get (full) backtraces for user space applications and shared libraries that are not mentioned in the current script, run stap with:

-d /path/to/exe-or-so

and/or add:

--ldd

to load all needed unwind data. do this or your backtrace will be giving "where is everybody" energy πŸ™ˆ


πŸŽ€ SEE ALSO πŸŽ€


SystemTap Tapset Reference, September 2026 edition β€” mwah, thanks for reading bestie, now go get those unwound stacks, slay, bye πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from