pidpersec.bt(8)

πŸ“¦ version 0.17.0, in debian bookworm

🌸 pidpersec.bt β€” the manual page, but make it cute (8) 🌸

okay bestie, welcome to pidpersec.bt from the System Manager's Manual section of your life πŸ’– it lives in section 8, it's a bpftrace/eBPF situation, and it's genuinely so useful. let's get into it.


✨ NAME ✨

pidpersec.bt β€” counts new processes (via fork()). uses bpftrace/eBPF. that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

pidpersec.bt

yeah that's it. no flags, no arguments, no drama. she just runs. πŸ‘‘


✨ DESCRIPTION ✨

so pidpersec shows you how many new processes got created each second. that's it, that's the girl. πŸŽ€

why do you care? because bestie, there can be performance issues caused by a ton of short-lived processes β€” and those little guys are basically invisible to sampling tools like top(1). they spawn, they die, they never get sampled. pidpersec gives you one way to actually investigate that behavior. πŸ•΅οΈβ€β™€οΈ

how does she do it? she works by tracing the tracepoint:sched:sched_process_fork tracepoint. iconic. ⭐

⚠️ since this uses BPF, only the root user can use this tool. like, actually only root. no cap.

✨ REQUIREMENTS ✨

  • CONFIG_BPF 🫢
  • bpftrace πŸ¦‹

✨ EXAMPLES ✨

count new processes, printing per-second summaries until you hit Ctrl-C:

# pidpersec.bt

just like that. live your life, then Ctrl-C when you're done. 😌


✨ FIELDS ✨

  • 1st β€” count of processes (it shows up after the @)

✨ OVERHEAD ✨

she traces kernel forks and keeps an in-kernel count that gets read asynchronously from user-space. and since the rate of this is generally expected to be low (<< 1000/s), the overhead is also expected to be negligible. so like, go off, it's fine. πŸ’œ


✨ SOURCE ✨

this one is from bpftrace. 🌈

https://github.com/iovisor/bpftrace

also, go look in the bpftrace distribution for a companion _examples.txt file β€” it's got example usage, output, and commentary for this tool. it's giving bonus content fr fr. πŸ“–

this is a bpftrace version of the bcc tool of the same name. heads up though: the bcc tool may provide more options and customizations. πŸ‘€

https://github.com/iovisor/bcc

✨ OS ✨

Linux 🐧


✨ STABILITY ✨

Unstable - in development. πŸ’€ she's still growing, be nice to her.


✨ AUTHOR ✨

Brendan Gregg πŸ‘‘ the icon, the legend, the moment.


✨ SEE ALSO ✨


and that's the whole page, bestie πŸ’– this was the USER COMMANDS manual, dated 2018-09-06, for pidpersec.bt(8) β€” mwah, go count some forks βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from