Content-type: text/html Man page of CPUSAGE

CPUSAGE

Section: User Commands (1)
Updated: 20 March 2006
Index Return to Main Contents

 

NAME

cpusage - shows CPU usage of the system

 

SYNOPSIS

cpusage [ -hos ] [ -a | -l limit ]

 

AVAILABILITY

As source for Linux and FreeBSD. Tested with Linux 2.4 & 2.6 and FreeBSD 5. But adaption to other UNIX's should only be a problem of getting the tics counters from the kernel.

Download from:
http://www.net.informatik.tu-muenchen.de/~schneifa/sources/

 

DESCRIPTION

This tool reads out the tics counter of the operating system and calculates the Percentages spend in each CPU_STATE. This is done twice per second. The output is send to standard out. Supplementary the minimum, maximum and average percentages are displayed. The recording for the average measuring can be limited to start only if the idle value drops under a certain limit (set with the -l limit option) and stops if the idle value returns over that limit again.

The program will execute until a SIGINT is received. This can be done by pressing Strg+C in the corresponding shell or by invoking

kill -SIGINT PID

where PID is the process ID of cpusage. If your system does not allow to use kill in the described manner, please refer to kill(1) for details.

 

OPTIONS

-a
build average over the whole time, same as -l 100
-h
prints the help
-c CPUnum
Select a special CPU/Core to monitor, when not set all CPU/Cores are aggregated. (Only available for Linux so far).
-l limit
set limits for average usage snapping
-o
format the output machine readable (see OUTPUT FORMAT for details)
-s
run only once and exit. In addition, the summary is not calculated and printed.

 

OUTPUT FORMAT

The output depends on the available information delivered from the kernel this can be differ between operating system and even between different versions of operating systems (e.g.: Linux 2.4.x and Linux 2.6.x). The difference is in the fields the tics are split:

Linux 2.4.x
user nice system idle are available (4 fields)
Linux 2.6.x
user nice system idle iowait irq soft_irq are available (7 fields)
FreeBSD
user nice system idle interrupt are available (5 fields)

The field will be printed in the upon mentioned order. For the example outputs FreeBSD was chosen.

 

Human readable (Default)

Every line consists of the fields each with name:value pairs:

user: 3.0%, nice: 0.0%, system: 0.7%, idle: 68.7%, interrupt: 27.6%,

 

Machine readable (set via the -o option)

In contrast to the previous output format, only the values are shown without the "%" sing:

0.0:0.0:0.0:70.7:29.3

 

SEE ALSO

top(1), uptime(1), kill(1)

 

AUTHOR

Fabian Schneider <fabian@net.in.tum.de>

 

BUGS

Please send problems, bugs, questions, desirable enhancements, source code contributions, etc. to:

fabian@net.in.tum.de


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
OUTPUT FORMAT
Human readable (Default)
Machine readable (set via the -o option)
SEE ALSO
AUTHOR
BUGS

This document was created by man2html, using the manual pages.
Time: 09:34:46 GMT, March 05, 2008