CPUSTAT(8) | System Manager's Manual | CPUSTAT(8) |
cpustat - a tool to measure CPU utilization.
cpustat [ options ] [delay [count]]
cpustat is a program that dumps the CPU utilization of current running tasks (that is, processes or kernel threads). cpustat is useful to monitor the activity of long lived processes in a system, such as daemons, kernel threads as well as typical user processes.
cpustat shows only the tasks that have measured any change in their CPU activity between each sample interval (as indicated by an increment in the CPU tick count stats of utime and stime in /proc/$pid/stat). cpustat thus only reports activity of busy tasks that are still alive at the time of each sample snapshot and hence will not account for very short lived processes that exist between each sample period.
For each running task that has consumed some CPU during the sample time, the following information is displayed:
Heading | Description |
%CPU | Total CPU used (in percent) |
%USR | CPU used in user space (in percent) |
%SYS | CPU used in system (kernel) space (in percent) |
PID | Process ID |
S | Process State |
CPU | CPU used by the process at time of sampling. |
Time | Total CPU time used by the process since it started. |
Task | Process command line information (from process cmdline or comm fields) |
cpustat was designed to try and minimize the CPU overhead of process statistics gathering and reporting. It is therefore ideal for small embedded devices where CPU is limited where measuring CPU utilisation may affect the overall CPU statistics. For this reason, it is not as complex as tools such as top(1) that have a more feature rich user interface.
R | Running |
S | Sleeping |
D | Waiting, Disk Sleep |
T | Stopped |
t | Tracing stopped |
W | Paging |
X or x | Dead |
K | Wakekill |
W | Waking |
P | Parked |
cpustat options are as follow:
cpustat
cpustat -n 20 60
cpustat 10 5
cpustat -x -D -a 1 300
cpustat was written by Colin Ian King <colin.i.king@gmail.com>
This manual page was written by Colin Ian King <colin.i.king@gmail.com>, for the Ubuntu project (but may be used by others).
Copyright © 2011-2021 Canonical Ltd, Copyright ©
2021 Colin Ian King
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
November 15, 2021 |