pidpersec.bt(8)
β¨ pidpersec.bt(8) β¨ π this is the manual page for pidpersec.bt, the tool that gives you the full scoop on your system's process births πΌ
β¨ NAME β¨
okay so pidpersec.bt is the tool that counts new processes (via fork()) π and it runs on bpftrace/eBPF π₯
π SYNOPSIS π
pidpersec.bt
π DESCRIPTION π
bestie, pidpersec tells you how many brand new processes got spun up every single second π¦ here's the tea: lots of short-lived processes can cause performance problems, and they can totally hide from sampling tools like top(1) π pidpersec is one way to actually catch them in the act π΅οΈββοΈ
this works by tracing the tracepoint:sched:sched_process_fork tracepoint β¨
and bc this runs on BPF, only the root user can use this tool π no cap, you need to be root π«Ά
π REQUIREMENTS π
you need CONFIG_BPF and bpftrace in your corner π
π§ EXAMPLES π§
here's how you count new processes, getting per-second summaries until you hit Ctrl-C πΈ
# pidpersec.bt
π FIELDS π
- 1st β the count of processes (the bit after "@") π
π OVERHEAD π
so this traces kernel forks and keeps an in-kernel count, which user-space reads asynchronously π«§ the rate is usually expected to be pretty low (<< 1000/s), so the overhead should be negligible π slay
π₯ SOURCE π₯
this comes straight from bpftrace π
https://github.com/bpftrace/bpftrace
also, look in the bpftrace distribution for a companion _examples.txt file π it has example usage, output, and commentary for this tool, iykyk π€
this is the bpftrace version of the bcc tool with the same name β¨ the bcc tool might give you more options and customizations, so check it out if you want more control π
https://github.com/iovisor/bcc
π¦ OS π¦
Linux, obviously π§
π STABILITY π
Unstable β it's still in development, so don't be shocked if things shift π
π AUTHOR π
written by Brendan Gregg, the legend himself π«Ά
π SEE ALSO π
- top(1) π
bye bestie π this was the USER COMMANDS manual page for pidpersec.bt(8), last updated 2018-09-06. stay curious and keep your forks in check π§π
π¦ where this page comes from
- alpine 3.24: bpftrace-tools-doc 0.26.1-r0 Β· Apache-2.0
- arch rolling: bpftrace 0.27.0-2 Β· Apache-2.0
- centos-stream 10: bpftrace 0.26.1-1.el10 Β· Apache-2.0
- centos-stream 9: bpftrace 0.26.1-1.el9 Β· ASL 2.0
- debian trixie: bpftrace 0.23.2-1 Β· Apache-2.0
- fedora 43: bpftrace 0.24.0-1.fc43 Β· Apache-2.0
- fedora 43: bpftrace 0.24.2-1.fc43 Β· Apache-2.0
- fedora 44: bpftrace 0.24.2-3.fc44 Β· Apache-2.0
- nixos 26.05: bpftrace 0.25.1
- nixpkgs unstable: bpftrace 0.27.1
- opensuse-leap 16.0: bpftrace-tools 0.23.5-160000.1.2 Β· Apache-2.0
- ubuntu questing: bpftrace 0.23.5-1ubuntu1 Β· Apache-2.0
- ubuntu resolute: bpftrace 0.25.0-1ubuntu1 Β· Apache-2.0
- ubuntu stonking: bpftrace 0.25.0-1ubuntu2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms