在 Ubuntu 上,cpustat 通常指 sysstat 包中的 mpstat 风格工具,也可能是 pcp(Performance Co-Pilot)里的 cpustat。下面分别说明。
mpstat(常被叫 cpustat)sudo apt update
sudo apt install sysstat
mpstat
输出示例:
Linux 6.5.0 (ubuntu) 2026-01-21 _x86_64_
10:00:00 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
10:00:01 all 5.00 0.00 2.00 0.50 0.00 0.00 0.00 0.00 0.00 92.50
mpstat 1 5
mpstat -P ALL 1 3
%usr:用户态 CPU 使用率%sys:内核态 CPU 使用率%iowait:等待 IO 的时间%idle:空闲 CPU%steal:虚拟机被 Hypervisor 偷走的时间cpustat(较少用)如果你装的是 pcp:
sudo apt install pcp
cpustat
示例输出:
CPU util u s i w irq soft
0 12 8 3 1 0 0 0
1 05 3 2 0 0 0 0
含义类似,只是格式不同。
top
htop
cat /proc/stat
sudo apt install sysstat → 用 mpstatmpstat -P ALLmpstat 1如果你说的 cpustat 是某个具体工具(比如某个监控脚本或 Go 工具),可以把输出贴出来,我可以帮你逐字段解释。