cpuwalk.bt(8)

๐Ÿ“ฆ
version 0.27.0 ยท 3 versions
  • 0.27.0 ยท alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.14.0 ยท ubuntu jammy
  • 0.20.2 ยท ubuntu noble
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

๐ŸŽ€ NAME ๐ŸŽ€

okay so this manual is for cpuwalk.bt(8), from the System Manager's Manual ๐Ÿ’… It's the bestie that tells you which CPUs are actually running processes. cpuwalk.bt is a bpftrace/eBPF tool that samples the sample which CPUs are executing processes.. ๐Ÿงš

โœจ SYNOPSIS โœจ

cpuwalk.bt

๐Ÿ’– DESCRIPTION ๐Ÿ’–

okay so this tool samples your CPUs at 99 Hertz ๐Ÿ”ฅ and then prints a histogram showing which CPUs were active. Why 99 and not a nice round 100? Because 99 Hertz avoids lockstep sampling, which would skew your results. It's giving accuracy ๐Ÿ˜ญ

This is the vibe check for your app: it can help you figure out if your workload is evenly spreading across the CPUs, or if there's an imbalance problem ๐Ÿ’€

Since this uses BPF, only the root user can use this tool. No cap, you need to be root ๐Ÿ‘‘

๐Ÿฆ‹ REQUIREMENTS ๐Ÿฆ‹

You'll need CONFIG_BPF and bpftrace. Those are the non-negotiables, bestie โœจ

๐ŸŒธ EXAMPLES ๐ŸŒธ

Sample the CPUs and get a summary when you hit Ctrl-C ๐ŸŽ€

# cpuwalk.bt

๐Ÿ“ FIELDS ๐Ÿ“

  • 1st, 2nd โ€” The CPU shows up in the first field, right after the [. Ignore the second field, it's not the main character here ๐Ÿ™ˆ
  • 3rd โ€” A column with the number of samples for that CPU ๐Ÿ”ข
  • 4th โ€” An ASCII histogram that visualizes the count column. Cute bar chart energy ๐Ÿ“Š

๐ŸŒˆ OVERHEAD ๐ŸŒˆ

This should be negligible ๐Ÿซถ Basically no drama on your system.

๐Ÿ’œ SOURCE ๐Ÿ’œ

This one is from bpftrace, obviously ๐Ÿงš

https://github.com/bpftrace/bpftrace

Also, go look in the bpftrace distribution for a companion _examples.txt file. It has example usage, output, and commentary for this tool, so it's lowkey the best study guide ๐Ÿ“šโœจ

๐Ÿฆ„ OS ๐Ÿฆ„

Linux ๐Ÿง only, babe.

๐Ÿงช STABILITY ๐Ÿงช

Unstable - in development. So it's still cooking, don't be shocked if things shift ๐Ÿ™ˆ

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Brendan Gregg ๐Ÿ™Œ the legend himself.

๐Ÿ”ฎ SEE ALSO ๐Ÿ”ฎ

mpstat(1) is your bestie for this one ๐Ÿ’…


Sign-off: this page was from USER COMMANDS, dated 2018-09-08, and it's cpuwalk.bt(8) ๐ŸŽ€๐Ÿ’– ily, go sample those CPUs โœจ