Information Technology Reference
In-Depth Information
The prstat Command
The prstat(1M) command is used to generate a statistics report on active
processes. If used with no command-line arguments, information on all
active processes, sorted by CPU usage, is displayed. The report is updated
approximately every three seconds until prstat is killed. The following code
listing shows the use of the prstat command:
$ prstat
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
9793 ambro 1032K 844K cpu0 58 0 0:00.00 0.1% prstat/1
9789 ambro 2960K 2132K sleep 58 0 0:00.00 0.1% xterm/1
217 root 1908K 1100K sleep 53 0 0:00.00 0.1% nscd/7
312 root 1936K 660K sleep 48 0 0:00.00 0.1% mibiisa/12
397 root 64M 47M sleep 59 0 0:00.07 0.0% sdtperfmeter/1
9790 ambro 808K 628K sleep 41 0 0:00.00 0.0% sh/1
177 root 1576K 0K sleep 30 0 0:00.00 0.0% lockd/1
229 root 2692K 0K sleep 48 0 0:00.00 0.0% lpsched/1
165 root 1940K 696K sleep 58 0 0:00.00 0.0% in.named/1
180 daemon 2188K 152K sleep 53 0 0:00.00 0.0% statd/4
250 root 804K 480K sleep 58 0 0:00.00 0.0% utmpd/1
188 root 2720K 664K sleep 58 0 0:00.00 0.0% automountd/5
143 root 2144K 672K sleep 58 0 0:00.00 0.0% rpcbind/1
129 root 1552K 300K sleep 59 0 0:00.00 0.0% in.ndpd/1
122 root 1304K 220K sleep 58 0 0:00.00 0.0% in.routed/1
Total: 64 processes, 146 lwps, load averages: 0.11, 0.04, 0.05
$
The prstat command supports command-line arguments that can be used
to select the processes to monitor based on Process ID (PID), UID of
owner, CPU being used, and so on. Table 5.2 lists the prstat command-line
arguments.
Table 5.2
The prstat Command-Line Arguments
Argument
Description
-a
Displays separate reports on processes and users.
-c
Prints new reports instead of overprinting the initial report.
-C sets
Reports only processes bound to the specified processor sets .
-L
Reports on each lightweight process (LWP).
-m
Reports microstate information.
-n number
Restricts report to number lines in the window or on the terminal. The
default is to use the entire display.
-p pids
Reports only processes whose PIDs are listed by pids .
-P cpus
Reports only processes executing on the CPUs listed by cpus .
-R
Executes prstat in real-time mode.
-s key
Sorts report in descending order based on key ( cpu , time , size , rss, or pri ).
(continued)
Search WWH ::




Custom Search