uthreads(8)

πŸ“¦ version 0.36.1, in centos-stream 10, centos-stream 9, fedora 43, fedora 44

πŸŽ€ NAME πŸŽ€

uthreads, cthreads, and javathreads are the tools for the job, and they all do one thing: they trace thread creation events in Java or pthreads ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

cthreads [-h] [-v] pid
javathreads [-h] [-v] pid
uthreads [-h] [-l {c,java,none}] [-v] pid

πŸ’– DESCRIPTION πŸ’–

okay so this bad boy traces thread creation events in Java processes, or pthread creation events in any process 😭 Whenever a thread gets created, it prints out that thread's name or start address. iconic.

πŸ”’ Since this uses BPF, only the root user can run this tool. Not you, not me, only root πŸ’€

πŸ“‹ REQUIREMENTS πŸ“‹

You'll need CONFIG_BPF and bcc. No cap, you need both or it's not happening 🫢


🌸 OPTIONS 🌸

  • -l {c,java,none} β€” pick the language you want to trace. c and none only trace pthreads, no matter what runtime the process is actually running 🧚
  • -v β€” prints out the resulting BPF program. This is for debugging, so bring it out when something's acting sus πŸ”
  • pid β€” the process ID you want to trace πŸ“

🧚 EXAMPLES 🧚

Trace Java thread creations:

# uthreads -l java 148

Trace pthread creations:

# uthreads 1802

πŸ’… FIELDS πŸ’…

  • TIME β€” the event's time in seconds, counted from when the trace started ⏱️
  • ID β€” the thread's ID. What shows up here depends on the runtime, so it's giving "it depends" 🌈
  • TYPE β€” the event type: thread start, thread stop, or pthread event πŸ”₯
  • DESCRIPTION β€” the thread's name, or the function name of its start address ✨

🫧 OVERHEAD 🫧

Thread start and stop events don't happen all that often, so this tool's overhead is basically nothing. Lowkey iconic πŸ’œ


🌍 SOURCE 🌍

This one comes from bcc, bestie πŸ¦‹

https://github.com/iovisor/bcc

Also check out the bcc distribution for a companion _example.txt file. It has example usage, output, and commentary for this tool, and it's so worth a look πŸ“š


🐧 OS 🐧

Linux only 🐧


🚧 STABILITY 🚧

Unstable, still in development. Be gentle with it πŸ₯Ί


πŸ‘‘ AUTHOR πŸ‘‘

Sasha Goldshtein, the queen who made this ✨


πŸ”— SEE ALSO πŸ”—

ustat(8), trace(8)


Okay bestie, that's the whole manual for uthreads(8) from the USER COMMANDS section, dated 2018-10-09 πŸ’– Now go trace some threads and slay πŸ’…πŸ«Ά

πŸ“¦ where this page comes from