pidstat

Langue: en

Version: 43056 (openSuse - 09/10/07)

Section: 1 (Commandes utilisateur)

NAME

pidstat - Report statistics for Linux tasks.

SYNOPSIS

pidstat [ -C comm ] [ -d ] [ -I ] [ -p { pid | SELF | ALL } ] [ -r ] [ -u ] [ -V ] [ interval [ count ] ]

DESCRIPTION

The pidstat command is used for monitoring individual tasks currently being managed by the Linux kernel. It writes to standard output activities for every task selected with option -p or for every task managed by the Linux kernel if option -p ALL has been used. If no task has been explicitly selected (i.e. option -p has not been entered on the command line) then only active tasks will appear in the report.

The interval parameter specifies the amount of time in seconds between each report. A value of 0 (or no parameters at all) indicates that tasks statistics are to be reported for the time since system startup (boot). The count parameter can be specified in conjunction with the interval parameter if this one is not set to zero. The value of count determines the number of reports generated at interval seconds apart. If the interval parameter is specified without the count parameter, the pidstat command generates reports continuously.

You can select information about specific system activities using flags. Not specifying any flags selects only CPU activity.

OPTIONS

-C comm
Display only tasks whose command name includes the string comm.
-d
Report I/O statistics (kernels 2.6.20 and later only). The following values are displayed:

PID

The identification number of the task being monitored.

kB_rd/s

Number of kilobytes the task has caused to be read from disk per second.

kB_wr/s

Number of kilobytes the task has caused, or shall cause to be written to disk per second.

kB_ccwr/s

Number of kilobytes whose writing to disk has been cancelled by the task. This may occur when the task truncates some dirty pagecache. In this case, some IO which another task has been accounted for will not be happening.

Command

The command name of the task.
-I
In an SMP environment, indicate that tasks CPU usage (as displayed by option -u ) should be divided by the total number of processors.
-p { pid | SELF | ALL }
Select tasks (processes) for which statistics are to be reported. pid is the process identification number. The SELF keyword indicates that statistics are to be reported for the pidstat process itself, whereas the ALL keyword indicates that statistics are to be reported for all the tasks managed by the system.
-r
Report page faults and memory utilization. The following values are displayed:

PID

The identification number of the task being monitored.

minflt/s

Total number of minor faults the task has made per second, those which have not required loading a memory page from disk.

majflt/s

Total number of major faults the task has made per second, those which have required loading a memory page from disk.

VSZ

Virtual Size: The virtual memory usage of entire task in kilobytes.

RSS

Resident Set Size: The non-swapped physical memory used by the task in kilobytes.

Command

The command name of the task.
-u
Report CPU utilization. The following values are displayed:

PID

The identification number of the task being monitored.

%user

Percentage of CPU used by the task while executing at the user level (application), with or without nice priority.

%system

Percentage of CPU used by the task while executing at the system level (kernel).

%CPU

Total percentage of CPU time used by the task. In an SMP environment, the task's CPU usage will be divided by the total number of CPU's if option -I has been entered on the command line.

CPU

Processor number to which the task is attached.

Command

The command name of the task.
-V
Print version number then exit.

ENVIRONMENT

The pidstat command takes into account the following environment variable:
S_TIME_FORMAT
If this variable exists and its value is ISO then the current locale will be ignored when printing the date in the report header. The pidstat command will use the ISO 8601 format (YYYY-MM-DD) instead.

EXAMPLES

pidstat 2 5
Display five reports of CPU statistics for every active task in the system at two second intervals.

pidstat -r -p 1643 2 5

Display five reports of page faults and memory statistics for PID 1643 at two second intervals.

BUGS

/proc filesystem must be mounted for the pidstat command to work.

FILES

/proc contains various files with system statistics.

AUTHOR

Sebastien Godard (sysstat <at> wanadoo.fr)

SEE ALSO

sar(1), top(1), ps(1), mpstat(1), iostat(1), vmstat(8)

http://perso.orange.fr/sebastien.godard/