6324 Add an `ndp' tool for manipulating the neighbors table
[illumos-gate.git] / usr / src / man / man1m / prstat.1m
bloba5f02621cf09fdb7f41c2075d8a0e872679e87ea
1 '\" te
2 .\" Copyright (c) 2013 Gary Mills
3 .\" Copyright (c) 2006, 2009 Sun Microsystems, Inc. All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
5 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
6 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH PRSTAT 1M "Nov 14, 2014"
8 .SH NAME
9 prstat \- report active process statistics
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBprstat\fR [\fB-acHJLmRrtTvWZ\fR] [\fB-d\fR u | d] [\fB-C\fR \fIpsrsetlist\fR] [\fB-h\fR \fIlgrplist\fR]
14      [\fB-j\fR \fIprojlist\fR] [\fB-k\fR \fItasklist\fR] [\fB-n\fR \fIntop\fR[,\fInbottom\fR]]
15      [\fB-p\fR \fIpidlist\fR] [\fB-P\fR \fIcpulist\fR] [\fB-s\fR \fIkey\fR | \fB-S\fR \fIkey\fR ]
16      [\fB-u\fR \fIeuidlist\fR] [\fB-U\fR \fIuidlist\fR] [\fB-z\fR \fIzoneidlist\fR]
17      [\fIinterval\fR [\fIcount\fR]]
18 .fi
20 .SH DESCRIPTION
21 .LP
22 The \fBprstat\fR utility iteratively examines all active processes on the
23 system and reports statistics based on the selected output mode and sort order.
24 \fBprstat\fR provides options to examine only processes matching specified
25 \fBPID\fRs, \fBUID\fRs, zone \fBID\fRs, \fBCPU\fR \fBID\fRs, and processor set
26 \fBID\fRs.
27 .sp
28 .LP
29 The \fB-j\fR, \fB-k\fR, \fB-C\fR, \fB-p\fR, \fB-P\fR, \fB-u\fR, \fB-U\fR, and
30 \fB-z\fR options accept lists as arguments. Items in a list can be either
31 separated by commas or enclosed in quotes and separated by commas or spaces.
32 .sp
33 .LP
34 If you do not specify an option, \fBprstat\fR examines all processes and
35 reports statistics sorted by \fBCPU\fR usage.
36 .SH OPTIONS
37 .LP
38 The following options are supported:
39 .sp
40 .ne 2
41 .na
42 \fB\fB-a\fR\fR
43 .ad
44 .sp .6
45 .RS 4n
46 Report information about processes and users. In this mode \fBprstat\fR
47 displays separate reports about processes and users at the same time.
48 .RE
50 .sp
51 .ne 2
52 .na
53 \fB\fB-c\fR\fR
54 .ad
55 .sp .6
56 .RS 4n
57 Print new reports below previous reports instead of overprinting them.
58 Long names are not truncated in this mode.
59 .RE
61 .sp
62 .ne 2
63 .na
64 \fB\fB-C\fR \fIpsrsetlist\fR\fR
65 .ad
66 .sp .6
67 .RS 4n
68 Report only processes or lwps that are bound to processor sets in the given
69 list. Each processor set is identified by an integer as reported by
70 \fBpsrset\fR(1M). The load averages displayed are the sum of the load averages
71 of the specified processor sets (see \fBpset_getloadavg\fR(3C)). Processes with
72 one or more LWPs bound to processor sets in the given list are reported even
73 when the \fB-L\fR option is not used.
74 .RE
76 .sp
77 .ne 2
78 .na
79 \fB\fB-d\fR \fBu | d\fR\fR
80 .ad
81 .sp .6
82 .RS 4n
83 Specify \fBu\fR for a printed representation of the internal representation of
84 time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See
85 \fBdate\fR(1).
86 .RE
88 .sp
89 .ne 2
90 .na
91 \fB\fB-h\fR \fIlgrplist\fR\fR
92 .ad
93 .sp .6
94 .RS 4n
95 Report only processes or lwps whose home \fIlgroup\fR is in the given list of
96 \fIlgroups\fR. No processes or lwps will be listed for invalid \fIlgroups\fR.
97 .RE
99 .sp
100 .ne 2
102 \fB\fB-H\fR\fR
104 .sp .6
105 .RS 4n
106 Report information about home \fIlgroup\fR. In this mode, \fBprstat\fR adds an
107 extra column showing process or lwps home \fIlgroup\fR with the header LGRP.
111 .ne 2
113 \fB\fB-j\fR \fIprojlist\fR\fR
115 .sp .6
116 .RS 4n
117 Report only processes or lwps whose project \fBID\fR is in the given list. Each
118 project \fBID\fR can be specified as either a project name or a numerical
119 project \fBID\fR. See \fBproject\fR(4).
123 .ne 2
125 \fB\fB-J\fR\fR
127 .sp .6
128 .RS 4n
129 Report information about processes and projects. In this mode \fBprstat\fR
130 displays separate reports about processes and projects at the same time.
131 A trailing asterisk marks a long name that has been truncated
132 to fit the column.
136 .ne 2
138 \fB\fB-k\fR \fItasklist\fR\fR
140 .sp .6
141 .RS 4n
142 Report only processes or lwps whose task \fBID\fR is in \fItasklist\fR.
146 .ne 2
148 \fB\fB-L\fR\fR
150 .sp .6
151 .RS 4n
152 Report statistics for each light-weight process (\fBLWP\fR). By default,
153 \fBprstat\fR reports only the number of \fBLWP\fRs for each process.
157 .ne 2
159 \fB\fB-m\fR\fR
161 .sp .6
162 .RS 4n
163 Report microstate process accounting information. In addition to all fields
164 listed in \fB-v\fR mode, this mode also includes the percentage of time the
165 process has spent processing system traps, text page faults, data page faults,
166 waiting for user locks and waiting for \fBCPU\fR (latency time).
170 .ne 2
172 \fB\fB-n\fR \fIntop\fR[\fI,nbottom\fR]\fR
174 .sp .6
175 .RS 4n
176 Restrict number of output lines. The \fIntop\fR argument determines how many
177 lines of process or \fBlwp\fR statistics are reported, and the \fInbottom\fR
178 argument determines how many lines of user, task, project or zone statistics
179 are reported if the \fB-a\fR, \fB-t\fR, \fB-T\fR, \fB-J\fR or \fB-Z\fR options
180 are specified. By default, \fBprstat\fR displays as many lines of output that
181 fit in a window or terminal. When you specify the \fB-c\fR option or direct the
182 output to a file, the default values for \fBntop\fR and \fBnbottom\fR are
183 \fB15\fR and \fB5\fR.
187 .ne 2
189 \fB\fB-p\fR \fIpidlist\fR\fR
191 .sp .6
192 .RS 4n
193 Report only processes whose process \fBID\fR is in the given list.
197 .ne 2
199 \fB\fB-P\fR \fIcpulist\fR\fR
201 .sp .6
202 .RS 4n
203 Report only processes or \fBlwp\fRs which have most recently executed on a
204 \fBCPU\fR in the given list. Each \fBCPU\fR is identified by an integer as
205 reported by \fBpsrinfo\fR(1M).
209 .ne 2
211 \fB\fB-R\fR\fR
213 .sp .6
214 .RS 4n
215 Put \fBprstat\fR in the real time scheduling class. When this option is used,
216 \fBprstat\fR is given priority over time-sharing and interactive processes.
217 This option is available only for superuser.
221 .ne 2
223 \fB\fB-r\fR\fR
225 .sp .6
226 .RS 4n
227 Disable lookups for user names and project names. (Note that this does not
228 apply to lookups for the \fB-j\fR, \fB-u\fR, or \fB-U\fR options.)
232 .ne 2
234 \fB\fB-s\fR \fIkey\fR\fR
236 .sp .6
237 .RS 4n
238 Sort output lines (that is, processes, \fBlwp\fRs, or users) by \fIkey\fR in
239 descending order. Only one \fIkey\fR can be used as an argument.
241 There are five possible key values:
243 .ne 2
245 \fBcpu\fR
247 .sp .6
248 .RS 4n
249 Sort by process \fBCPU\fR usage. This is the default.
253 .ne 2
255 \fBpri\fR
257 .sp .6
258 .RS 4n
259 Sort by process priority.
263 .ne 2
265 \fBrss\fR
267 .sp .6
268 .RS 4n
269 Sort by resident set size.
273 .ne 2
275 \fBsize\fR
277 .sp .6
278 .RS 4n
279 Sort by size of process image.
283 .ne 2
285 \fBtime\fR
287 .sp .6
288 .RS 4n
289 Sort by process execution time.
295 .ne 2
297 \fB\fB-S\fR \fIkey\fR\fR
299 .sp .6
300 .RS 4n
301 Sort output lines by \fIkey\fR in ascending order. Possible \fIkey\fR values
302 are the same as for the \fB-s\fR option. See \fB-s\fR.
306 .ne 2
308 \fB\fB-t\fR\fR
310 .sp .6
311 .RS 4n
312 Report total usage summary for each user. The summary includes the total number
313 of processes or \fBLWP\fRs owned by the user, total size of process images,
314 total resident set size, total cpu time, and percentages of recent cpu time and
315 system memory.
319 .ne 2
321 \fB\fB-T\fR\fR
323 .sp .6
324 .RS 4n
325 Report information about processes and tasks. In this mode \fBprstat\fR
326 displays separate reports about processes and tasks at the same time.
330 .ne 2
332 \fB\fB-u\fR \fIeuidlist\fR\fR
334 .sp .6
335 .RS 4n
336 Report only processes whose effective user \fBID\fR is in the given list. Each
337 user \fBID\fR may be specified as either a login name or a numerical user
338 \fBID\fR.
342 .ne 2
344 \fB\fB-U\fR \fIuidlis\fRt\fR
346 .sp .6
347 .RS 4n
348 Report only processes whose real user \fBID\fR is in the given list. Each user
349 \fBID\fR may be specified as either a login name or a numerical user \fBID\fR.
353 .ne 2
355 \fB\fB-v\fR\fR
357 .sp .6
358 .RS 4n
359 Report verbose process usage. This output format includes the percentage of
360 time the process has spent in user mode, in system mode, and sleeping. It also
361 includes the number of voluntary and involuntary context switches, system calls
362 and the number of signals received. Statistics that are not reported are marked
363 with the \fB-\fR sign.
367 .ne 2
369 \fB\fB-W\fR\fR
371 .sp .6
372 .RS 4n
373 Truncate long names even when \fBprstat\fR would normally print them
374 in full.
375 A trailing asterisk marks a long name that has been truncated
376 to fit the column.
380 .ne 2
382 \fB\fB-z\fR \fIzoneidlist\fR\fR
384 .sp .6
385 .RS 4n
386 Report only processes or LWPs whose zone ID is in the given list. Each zone ID
387 can be specified as either a zone name or a numerical zone ID. See
388 \fBzones\fR(5).
392 .ne 2
394 \fB\fB-Z\fR\fR
396 .sp .6
397 .RS 4n
398 Report information about processes and zones. In this mode, \fBprstat\fR
399 displays separate reports about processes and zones at the same time.
400 A trailing asterisk marks a long name that has been truncated
401 to fit the column.
404 .SH OUTPUT
406 The following list defines the column headings and the meanings of a
407 \fBprstat\fR report:
409 .ne 2
411 \fBPID\fR
413 .sp .6
414 .RS 4n
415 The process \fBID\fR of the process.
419 .ne 2
421 \fBUSERNAME\fR
423 .sp .6
424 .RS 4n
425 The real user (login) name or real user \fBID\fR.
426 A trailing asterisk marks a long name that has been truncated
427 to fit the column.
431 .ne 2
433 \fBSWAP\fR
435 .sp .6
436 .RS 4n
437 The total virtual memory size of the process, including all mapped files and
438 devices, in kilobytes (\fBK\fR), megabytes (\fBM\fR), or gigabytes (\fBG\fR).
442 .ne 2
444 \fBRSS\fR
446 .sp .6
447 .RS 4n
448 The resident set size of the process (\fBRSS\fR), in kilobytes (\fBK\fR),
449 megabytes (\fBM\fR), or gigabytes (\fBG\fR). The RSS value is an estimate
450 provided by \fBproc\fR(4) that might underestimate the actual resident set
451 size. Users who want to get more accurate usage information for capacity
452 planning should use the \fB-x\fR option to \fBpmap\fR(1) instead.
456 .ne 2
458 \fBSTATE\fR
460 .sp .6
461 .RS 4n
462 The state of the process:
464 .ne 2
466 \fBcpu\fIN\fR\fR
468 .sp .6
469 .RS 4n
470 Process is running on \fBCPU\fR \fIN\fR.
474 .ne 2
476 \fBsleep\fR
478 .sp .6
479 .RS 4n
480 Sleeping: process is waiting for an event to complete.
484 .ne 2
486 \fBwait\fR
488 .sp .6
489 .RS 4n
490 Waiting: process is waiting for CPU usage to drop to the CPU-caps enforced
491 limits. See the description of \fBCPU-caps\fR in \fBresource_controls\fR(5).
495 .ne 2
497 \fBrun\fR
499 .sp .6
500 .RS 4n
501 Runnable: process in on run queue.
505 .ne 2
507 \fBzombie\fR
509 .sp .6
510 .RS 4n
511 Zombie state: process terminated and parent not waiting.
515 .ne 2
517 \fBstop\fR
519 .sp .6
520 .RS 4n
521 Process is stopped.
527 .ne 2
529 \fBPRI\fR
531 .sp .6
532 .RS 4n
533 The priority of the process. Larger numbers mean higher priority.
537 .ne 2
539 \fBNICE\fR
541 .sp .6
542 .RS 4n
543 Nice value used in priority computation. Only processes in certain scheduling
544 classes have a nice value.
548 .ne 2
550 \fBTIME\fR
552 .sp .6
553 .RS 4n
554 The cumulative execution time for the process.
558 .ne 2
560 \fBCPU\fR
562 .sp .6
563 .RS 4n
564 The percentage of recent \fBCPU\fR time used by the process. If executing in a
565 non-global \fBzone\fR and the pools facility is active, the percentage will be
566 that of the processors in the processor set in use by the pool to which the
567 \fBzone\fR is bound.
571 .ne 2
573 \fBPROCESS\fR
575 .sp .6
576 .RS 4n
577 The name of the process (name of executed file).
581 .ne 2
583 \fBLWPID\fR
585 .sp .6
586 .RS 4n
587 The \fBlwp\fR \fBID\fR of the \fBlwp\fR being reported.
591 .ne 2
593 \fBNLWP\fR
595 .sp .6
596 .RS 4n
597 The number of \fBlwp\fRs in the process.
602 With the some options, in addition to a number of the column headings shown
603 above, there are:
605 .ne 2
607 \fBNPROC\fR
609 .sp .6
610 .RS 4n
611 Number of processes in a specified collection.
615 .ne 2
617 \fBMEMORY\fR
619 .sp .6
620 .RS 4n
621 Percentage of memory used by a specified collection of processes.
626 The following columns are displayed when the \fB-v\fR or \fB-m\fR option is
627 specified
629 .ne 2
631 \fBUSR\fR
633 .sp .6
634 .RS 4n
635 The percentage of time the process has spent in user mode.
639 .ne 2
641 \fBSYS\fR
643 .sp .6
644 .RS 4n
645 The percentage of time the process has spent in system mode.
649 .ne 2
651 \fBTRP\fR
653 .sp .6
654 .RS 4n
655 The percentage of time the process has spent in processing system traps.
659 .ne 2
661 \fBTFL\fR
663 .sp .6
664 .RS 4n
665 The percentage of time the process has spent processing text page faults.
669 .ne 2
671 \fBDFL\fR
673 .sp .6
674 .RS 4n
675 The percentage of time the process has spent processing data page faults.
679 .ne 2
681 \fBLCK\fR
683 .sp .6
684 .RS 4n
685 The percentage of time the process has spent waiting for user locks.
689 .ne 2
691 \fBSLP\fR
693 .sp .6
694 .RS 4n
695 The percentage of time the process has spent sleeping.
699 .ne 2
701 \fBLAT\fR
703 .sp .6
704 .RS 4n
705 The percentage of time the process has spent waiting for CPU.
709 .ne 2
711 \fBVCX\fR
713 .sp .6
714 .RS 4n
715 The number of voluntary context switches.
719 .ne 2
721 \fBICX\fR
723 .sp .6
724 .RS 4n
725 The number of involuntary context switches.
729 .ne 2
731 \fBSCL\fR
733 .sp .6
734 .RS 4n
735 The number of system calls.
739 .ne 2
741 \fBSIG\fR
743 .sp .6
744 .RS 4n
745 The number of signals received.
750 Under the \fB-L\fR option, one line is printed for each \fBlwp\fR in the
751 process and some reporting fields show the values for the \fBlwp\fR, not the
752 process.
755 The following column is displayed when the \fB-H\fR option is specified:
757 .ne 2
759 \fBLGRP\fR
761 .sp .6
762 .RS 4n
763 The home \fIlgroup\fR of the process or lwp.
766 .SH OPERANDS
768 The following operands are supported:
770 .ne 2
772 \fB\fIcount\fR\fR
774 .sp .6
775 .RS 4n
776 Specifies the number of times that the statistics are repeated. By default,
777 \fBprstat\fR reports statistics until a termination signal is received.
781 .ne 2
783 \fB\fIinterval\fR\fR
785 .sp .6
786 .RS 4n
787 Specifies the sampling interval in seconds; the default interval is \fB5\fR
788 seconds.
791 .SH EXAMPLES
793 \fBExample 1 \fRReporting the Five Most Active Super-User Processes
796 The following command reports the five most active super-user processes running
797 on \fBCPU1\fR and \fBCPU2\fR:
800 .in +2
802 example% prstat -u root -n 5 -P 1,2 1 1
804 PID   USERNAME  SWAP   RSS STATE  PRI  NICE      TIME  CPU PROCESS/LWP
805  306   root     3024K 1448K sleep   58    0   0:00.00 0.3% sendmail/1
806  102   root     1600K  592K sleep   59    0   0:00.00 0.1% in.rdisc/1
807  250   root     1000K  552K sleep   58    0   0:00.00 0.0% utmpd/1
808  288   root     1720K 1032K sleep   58    0   0:00.00 0.0% sac/1
809    1   root      744K  168K sleep   58    0   0:00.00 0.0% init/1
810 TOTAL:       25, load averages:  0.05, 0.08, 0.12
812 .in -2
816 \fBExample 2 \fRDisplaying Verbose Process Usage Information
819 The following command displays verbose process usage information about
820 processes with lowest resident set sizes owned by users \fBroot\fR and
821 \fBjohn\fR.
824 .in +2
826 example% prstat -S rss -n 5 -vc -u root,john
828  PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/LWP
829    1 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 init/1
830  102 root     0.0 0.0  -   -   -   -  100  -    0   0   3   0 in.rdisc/1
831  250 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 utmpd/1
832 1185 john    0.0 0.0  -   -   -   -  100  -    0   0   0   0 csh/1
833  240 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 powerd/4
834  TOTAL:       71, load averages:  0.02, 0.04, 0.08
837 .in -2
840 .SH EXIT STATUS
842 The following exit values are returned:
844 .ne 2
846 \fB\fB0\fR\fR
848 .sp .6
849 .RS 4n
850 Successful completion.
854 .ne 2
856 \fB\fB1\fR\fR
858 .sp .6
859 .RS 4n
860 An error occurred.
863 .SH SEE ALSO
865 \fBdate\fR(1), \fBlgrpinfo\fR(1), \fBplgrp\fR(1), \fBproc\fR(1), \fBps\fR(1),
866 \fBtime\fR(2), \fBpsrinfo\fR(1M), \fBpsrset\fR(1M), \fBsar\fR(1M),
867 \fBpset_getloadavg\fR(3C), \fBproc\fR(4), \fBproject\fR(4),
868 \fBattributes\fR(5), \fBresource_controls\fR(5), \fBzones\fR(5)
869 .SH NOTES
871 The snapshot of system usage displayed by \fBprstat\fR is true only for a
872 split-second, and it may not be accurate by the time it is displayed. When the
873 \fB-m\fR option is specified, \fBprstat\fR tries to turn on microstate
874 accounting for each process; the original state is restored when \fBprstat\fR
875 exits. See \fBproc\fR(4) for additional information about the microstate
876 accounting facility.
879 The total memory size reported in the SWAP and RSS columns for groups of
880 processes can sometimes overestimate the actual amount of memory used by
881 processes with shared memory segments.