threadsnoop(8)

✨ threadsnoop(8) ✨

okay so the NAME is threadsnoop 🧚 β€” it's the tool that traces thread creation via pthread_create() and it uses BCC/eBPF to do it πŸ’œ

πŸ’… SYNOPSIS

threadsnoop

🌸 DESCRIPTION

okay so threadsnoop traces calls to pthread_create() and shows you this path of thread creation πŸ‘€ this is giving workload characterization and discovery vibes, and it's a bestie of execsnoop(8) which traces execve(2) 🫢

this works by tracing the pthread_create() from libpthread.so.0 ✨ the path to this library might need adjusting in the tool source so it matches your system, so keep that in mind πŸ™ˆ

since this uses BPF, only the root user can use this tool πŸ’€ no cap, not me being bossy, it's just how it works 😭

πŸŽ€ REQUIREMENTS

you need CONFIG_BPF and BCC πŸ”₯

πŸ¦‹ EXAMPLES

trace calls to pthread_create():

# threadsnoop

πŸ“ FIELDS

  • TIME(ms) β€” the elapsed time since the tool started tracing, in milliseconds ⏰
  • PID β€” the process ID πŸͺͺ
  • COMM β€” the process (thread) name 🧡
  • FUNC β€” the name of the start routine if the symbol is available, otherwise a hex address for the start routine address πŸ”

🌈 OVERHEAD

thread creation is expected to be low (<< 1000/s), so the overhead of this tool is expected to be negligible πŸ₯° lowkey iconic

⭐ SOURCE

this originated as a bpftrace tool from the book "BPF Performance Tools", published by Addison Wesley (2019) πŸ“š

http://www.brendangregg.com/bpf-performance-tools-book.html

see the book for more documentation on this tool πŸ€“

this version lives in the BCC repository:

https://github.com/iovisor/bcc

also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool πŸ’–

🧚 OS

Linux 🐧

πŸ™ˆ STABILITY

Unstable - in development. 🚧

πŸ‘‘ AUTHOR

Brendan Gregg πŸ’œ

πŸ”— SEE ALSO


bestie, that's the whole page πŸŽ€ from threadsnoop(8) in the USER COMMANDS section, dated 2019-07-02, with love from the System Manager's Manual βœ¨πŸ’–