cpuwalk.bt(8)

πŸ“¦ version 0.17.0, in debian bookworm

πŸ’… cpuwalk.bt β€” the tea β˜•

okay bestie, gather round, because we're talking about cpuwalk.bt from the System Manager's Manual (section 8, we love a system manager moment) ✨


🌸 NAME 🌸

cpuwalk.bt β€” literally samples which CPUs are executing processes. yeah. that's the whole vibe. and it uses bpftrace/eBPF to do it πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

cpuwalk.bt

that's it. that's the whole thing. no args, no flags, just vibes πŸ‘‘


✨ DESCRIPTION ✨

so here's what's happening: this tool samples your CPUs at 99 Hertz, and then prints a histogram showing which CPUs were actually active πŸ”₯

and why 99 Hertz specifically, you ask? because 99 Hertz is used to avoid lockstep sampling β€” which would skew your results. like, we do NOT do skewed results in this house πŸ™…β€β™€οΈ no cap.

this tool can help you figure out if your application's workload is evenly using the CPUs, or if there's an imbalance problem going on. it's giving detective energy πŸ”

⚠️ okay important: since this uses BPF, only the root user can use this tool. root only. periodt. πŸ’…

🧚 REQUIREMENTS 🧚

  • CONFIG_BPF
  • bpftrace

both. you need both. that's the entry fee bestie 🎟️


🌈 EXAMPLES 🌈

sample CPUs and print a summary on Ctrl-C:

# cpuwalk.bt

so you run it, you watch it do its lil thing, and then you hit Ctrl-C and it gives you the summary. iconic behavior honestly 😭


πŸ“ FIELDS πŸ“

  • 1st, 2nd β€” the CPU is shown in the first field, right after the "[". as for the second field? disregard it. we don't know her. ignore her. πŸ™ˆ
  • 3rd β€” a column showing the number of samples for this CPU πŸ“Š
  • 4th β€” this is an ASCII histogram representing the count column ✨

🫢 OVERHEAD 🫢

this should be negligible. tiny. basically free. we love a low-cost queen πŸ‘‘


πŸ’œ SOURCE πŸ’œ

this is from bpftrace πŸ’–

https://github.com/iovisor/bpftrace

also, look in the bpftrace distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool. it's like the director's commentary track but for your tool 🎬


πŸ¦‹ OS πŸ¦‹

Linux 🐧


πŸ’€ STABILITY πŸ’€

Unstable β€” in development. she's still growing. still evolving. still in her development era 🌱


πŸ‘‘ AUTHOR πŸ‘‘

Brendan Gregg πŸ’–


⭐ SEE ALSO ⭐


okay and one last thing before you go, bestie β€” this little love letter came from USER COMMANDS, dated 2018-09-08, and it lives at cpuwalk.bt(8). write that down. or don't. it's on the page either way πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from