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
execsnoop(8)π«Ά
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 β¨π
π¦ where this page comes from
- debian bookworm: bpfcc-tools 0.26.0+ds-1 Β· Apache-2.0
- debian trixie: bpfcc-tools 0.31.0+ds-7 Β· Apache-2.0
- ubuntu jammy: bpfcc-tools 0.18.0+ds-2 Β· Apache-2.0
- ubuntu noble: bpfcc-tools 0.29.1+ds-1ubuntu7 Β· Apache-2.0
- ubuntu questing: bpfcc-tools 0.31.0+ds-7ubuntu2 Β· Apache-2.0
- ubuntu resolute: bpfcc-tools 0.35.0+ds-1ubuntu2 Β· Apache-2.0
- ubuntu stonking: bpfcc-tools 0.35.0+ds-1ubuntu4 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms