FUNCTION::NS_TID(3stap)

✨ NAME ✨

okay bestie, so this is function::ns_tid from the Context Functions chapter of the SystemTap Tapset Reference (that's the 3stap manual, iykyk) β€” and it returns the thread ID of a target process as seen in a pid namespace. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

ns_tid:long()

look at her. one function, zero drama, returns a long. she ate. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • None β€” literally nothing. no args, no stress, no "wait what do i pass in". she takes nothing and she gives you a thread ID. iconic behaviour. ✨

πŸ’– DESCRIPTION πŸ’–

so the way this works is: ns_tid hands you the thread ID of a target process, but β€” and this is the important part β€” the way that thread ID looks as seen in a pid namespace. πŸ‘‘

which namespace tho? bestie, it depends:

  • if a target pid namespace was provided, you get the thread ID as seen in that namespace.
  • if not, you get it as seen in the stap process namespace.

that's it. that's the function. no cap. 🫢

fr fr the whole point is that the same thread can have different IDs depending on which namespace you're peeking from, and this function respects that. don't @ me, that's just what the page says. πŸ’€

🌈 SEE ALSO 🌈

  • tapset::context(3stap) β€” go read the context tapset page too, she's the main character of this whole friend group. πŸ’œ

mwah πŸ’‹ that's the SystemTap Tapset Reference, September 2026 version, signing off β€” thanks for coming to my ted talk, now go probe something. πŸ§šβ€β™€οΈπŸŒŸ

πŸ“¦ where this page comes from