1prstat(1M)              System Administration Commands              prstat(1M)
2
3
4

NAME

6       prstat - report active process statistics
7

SYNOPSIS

9       prstat [-acHJLmRrtTv] [-d u | d] [-C psrsetlist] [-h lgrplist]
10            [-j projlist] [-k tasklist] [-n ntop[,nbottom]]
11            [-p pidlist] [-P cpulist] [-s key | -S key ]
12            [-u euidlist] [-U uidlist] [-z zoneidlist] [-Z]
13            [interval [count]]
14
15

DESCRIPTION

17       The  prstat  utility  iteratively  examines all active processes on the
18       system and reports statistics based on the  selected  output  mode  and
19       sort  order. prstat provides options to examine only processes matching
20       specified PIDs, UIDs, zone IDs, CPU IDs, and processor set IDs.
21
22
23       The -j, -k, -C, -p, -P, -u, -U, and -z options accept  lists  as  argu‐
24       ments. Items in a list can be either separated by commas or enclosed in
25       quotes and separated by commas or spaces.
26
27
28       If you do not specify an option,  prstat  examines  all  processes  and
29       reports statistics sorted by CPU usage.
30

OPTIONS

32       The following options are supported:
33
34       -a
35
36           Report  information  about processes and users. In this mode prstat
37           displays separate reports about processes and  users  at  the  same
38           time.
39
40
41       -c
42
43           Print  new  reports  below previous reports instead of overprinting
44           them.
45
46
47       -C psrsetlist
48
49           Report only processes or lwps that are bound to processor  sets  in
50           the  given  list. Each processor set is identified by an integer as
51           reported by psrset(1M). The load averages displayed are the sum  of
52           the load averages of the specified processor sets (see pset_getloa‐
53           davg(3C)). Processes with one or more LWPs bound to processor  sets
54           in the given list are reported even when the -L option is not used.
55
56
57       -d u | d
58
59           Specify  u for a printed representation of the internal representa‐
60           tion of time. See time(2). Specify d for standard date format.  See
61           date(1).
62
63
64       -h lgrplist
65
66           Report  only  processes  or  lwps whose home lgroup is in the given
67           list of lgroups. No processes or lwps will be  listed  for  invalid
68           lgroups.
69
70
71       -H
72
73           Report  information about home lgroup. In this mode, prstat adds an
74           extra column showing process or lwps home lgroup  with  the  header
75           LGRP.
76
77
78       -j projlist
79
80           Report  only  processes  or  lwps  whose project ID is in the given
81           list. Each project ID can be specified as either a project name  or
82           a numerical project ID. See project(4).
83
84
85       -J
86
87           Report  information  about  processes  and  projects.  In this mode
88           prstat displays separate reports about processes  and  projects  at
89           the same time.
90
91
92       -k tasklist
93
94           Report only processes or lwps whose task ID is in tasklist.
95
96
97       -L
98
99           Report  statistics for each light-weight process (LWP). By default,
100           prstat reports only the number of LWPs for each process.
101
102
103       -m
104
105           Report microstate process accounting information.  In  addition  to
106           all  fields listed in -v mode, this mode also includes the percent‐
107           age of time the process has spent  processing  system  traps,  text
108           page  faults,  data page faults, waiting for user locks and waiting
109           for CPU (latency time).
110
111
112       -n ntop[,nbottom]
113
114           Restrict number of output lines. The ntop argument  determines  how
115           many lines of process or lwp statistics are reported, and the nbot‐
116           tom argument determines how many lines of user, task,  or  projects
117           statistics are reported if the -a, -t, -T, or -J options are speci‐
118           fied. By default, prstat displays as many lines of output that  fit
119           in  a  window or terminal. When you specify the -c option or direct
120           the output to a file, the default values for ntop and  nbottom  are
121           15 and 5.
122
123
124       -p pidlist
125
126           Report only processes whose process ID is in the given list.
127
128
129       -P cpulist
130
131           Report  only processes or lwps which have most recently executed on
132           a CPU in the given list. Each CPU is identified by  an  integer  as
133           reported by psrinfo(1M).
134
135
136       -R
137
138           Put  prstat  in the real time scheduling class. When this option is
139           used, prstat is given priority over  time-sharing  and  interactive
140           processes. This option is available only for superuser.
141
142
143       -r
144
145           Disable  lookups  for user names and project names. (Note that this
146           does not apply to lookups for the -j, -u, or -U options.)
147
148
149       -s key
150
151           Sort output lines (that is, processes, lwps, or users)  by  key  in
152           descending order. Only one key can be used as an argument.
153
154           There are five possible key values:
155
156           cpu
157
158               Sort by process CPU usage. This is the default.
159
160
161           pri
162
163               Sort by process priority.
164
165
166           rss
167
168               Sort by resident set size.
169
170
171           size
172
173               Sort by size of process image.
174
175
176           time
177
178               Sort by process execution time.
179
180
181
182       -S key
183
184           Sort  output  lines  by key in ascending order. Possible key values
185           are the same as for the -s option. See -s.
186
187
188       -t
189
190           Report total usage summary for each user. The summary includes  the
191           total  number of processes or LWPs owned by the user, total size of
192           process images, total resident set size, total cpu time,  and  per‐
193           centages of recent cpu time and system memory.
194
195
196       -T
197
198           Report  information  about processes and tasks. In this mode prstat
199           displays separate reports about processes and  tasks  at  the  same
200           time.
201
202
203       -u euidlist
204
205           Report only processes whose effective user ID is in the given list.
206           Each user ID may be specified as either a login name or a numerical
207           user ID.
208
209
210       -U uidlist
211
212           Report only processes whose real user ID is in the given list. Each
213           user ID may be specified as either a login name or a numerical user
214           ID.
215
216
217       -v
218
219           Report  verbose process usage. This output format includes the per‐
220           centage of time the process has spent in user mode, in system mode,
221           and sleeping. It also includes the number of voluntary and involun‐
222           tary context switches, system  calls  and  the  number  of  signals
223           received.  Statistics  that  are not reported are marked with the -
224           sign.
225
226
227       -z zoneidlist
228
229           Report only processes or LWPs whose zone ID is in the  given  list.
230           Each  zone ID can be specified as either a zone name or a numerical
231           zone ID. See zones(5).
232
233
234       -Z
235
236           Report information about processes and zones. In this mode,  prstat
237           displays  separate  reports  about  processes and zones at the same
238           time.
239
240

OUTPUT

242       The following list defines the column headings and the  meanings  of  a
243       prstat report:
244
245       PID
246
247           The process ID of the process.
248
249
250       USERNAME
251
252           The real user (login) name or real user ID.
253
254
255       SWAP
256
257           The  total virtual memory size of the process, including all mapped
258           files and devices, in kilobytes (K), megabytes  (M),  or  gigabytes
259           (G).
260
261
262       RSS
263
264           The  resident  set  size  of  the  process (RSS), in kilobytes (K),
265           megabytes (M), or gigabytes (G). The RSS value is an estimate  pro‐
266           vided  by  proc(4) that might underestimate the actual resident set
267           size. Users who want to get more  accurate  usage  information  for
268           capacity planning should use the -x option to pmap(1) instead.
269
270
271       STATE
272
273           The state of the process:
274
275           cpuN
276
277               Process is running on CPU N.
278
279
280           sleep
281
282               Sleeping: process is waiting for an event to complete.
283
284
285           wait
286
287               Waiting:  process  is waiting for CPU usage to drop to the CPU-
288               caps enforced  limits.  See  the  description  of  CPU-caps  in
289               resource_controls(5).
290
291
292           run
293
294               Runnable: process in on run queue.
295
296
297           zombie
298
299               Zombie state: process terminated and parent not waiting.
300
301
302           stop
303
304               Process is stopped.
305
306
307
308       PRI
309
310           The priority of the process. Larger numbers mean higher priority.
311
312
313       NICE
314
315           Nice  value used in priority computation. Only processes in certain
316           scheduling classes have a nice value.
317
318
319       TIME
320
321           The cumulative execution time for the process.
322
323
324       CPU
325
326           The percentage of recent CPU time used by the process. If executing
327           in a non-global zone and the pools facility is active, the percent‐
328           age will be that of the processors in the processor set in  use  by
329           the pool to which the zone is bound.
330
331
332       PROCESS
333
334           The name of the process (name of executed file).
335
336
337       LWPID
338
339           The lwp ID of the lwp being reported.
340
341
342       NLWP
343
344           The number of lwps in the process.
345
346
347
348       With  the  some options, in addition to a number of the column headings
349       shown above, there are:
350
351       NPROC
352
353           Number of processes in a specified collection.
354
355
356       MEMORY
357
358           Percentage of memory used by a specified collection of processes.
359
360
361
362       The following columns are displayed when the -v or -m option is  speci‐
363       fied
364
365       USR
366
367           The percentage of time the process has spent in user mode.
368
369
370       SYS
371
372           The percentage of time the process has spent in system mode.
373
374
375       TRP
376
377           The  percentage  of time the process has spent in processing system
378           traps.
379
380
381       TFL
382
383           The percentage of time the process has spent processing  text  page
384           faults.
385
386
387       DFL
388
389           The  percentage  of time the process has spent processing data page
390           faults.
391
392
393       LCK
394
395           The percentage of time the  process  has  spent  waiting  for  user
396           locks.
397
398
399       SLP
400
401           The percentage of time the process has spent sleeping.
402
403
404       LAT
405
406           The percentage of time the process has spent waiting for CPU.
407
408
409       VCX
410
411           The number of voluntary context switches.
412
413
414       ICX
415
416           The number of involuntary context switches.
417
418
419       SCL
420
421           The number of system calls.
422
423
424       SIG
425
426           The number of signals received.
427
428
429
430       Under  the  -L  option, one line is printed for each lwp in the process
431       and some reporting fields show the values for the lwp, not the process.
432
433
434       The following column is displayed when the -H option is specified:
435
436       LGRP
437
438           The home lgroup of the process or lwp.
439
440

OPERANDS

442       The following operands are supported:
443
444       count
445
446           Specifies the number of times that the statistics are repeated.  By
447           default,  prstat  reports  statistics until a termination signal is
448           received.
449
450
451       interval
452
453           Specifies the sampling interval in seconds; the default interval is
454           5 seconds.
455
456

EXAMPLES

458       Example 1 Reporting the Five Most Active Super-User Processes
459
460
461       The following command reports the five most active super-user processes
462       running on CPU1 and CPU2:
463
464
465         example% prstat -u root -n 5 -P 1,2 1 1
466
467         PID   USERNAME  SWAP   RSS STATE  PRI  NICE      TIME  CPU PROCESS/LWP
468          306   root     3024K 1448K sleep   58    0   0:00.00 0.3% sendmail/1
469          102   root     1600K  592K sleep   59    0   0:00.00 0.1% in.rdisc/1
470          250   root     1000K  552K sleep   58    0   0:00.00 0.0% utmpd/1
471          288   root     1720K 1032K sleep   58    0   0:00.00 0.0% sac/1
472            1   root      744K  168K sleep   58    0   0:00.00 0.0% init/1
473         TOTAL:       25, load averages:  0.05, 0.08, 0.12
474
475
476
477       Example 2 Displaying Verbose Process Usage Information
478
479
480       The following command displays verbose process usage information  about
481       processes with lowest resident set sizes owned by users root and john.
482
483
484         example% prstat -S rss -n 5 -vc -u root,john
485
486          PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/LWP
487            1 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 init/1
488          102 root     0.0 0.0  -   -   -   -  100  -    0   0   3   0 in.rdisc/1
489          250 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 utmpd/1
490         1185 john    0.0 0.0  -   -   -   -  100  -    0   0   0   0 csh/1
491          240 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 powerd/4
492          TOTAL:       71, load averages:  0.02, 0.04, 0.08
493
494
495
496

EXIT STATUS

498       The following exit values are returned:
499
500       0
501
502           Successful completion.
503
504
505       1
506
507           An error occurred.
508
509

ATTRIBUTES

511       See attributes(5) for descriptions of the following attributes:
512
513
514
515
516       ┌─────────────────────────────┬─────────────────────────────┐
517       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
518       ├─────────────────────────────┼─────────────────────────────┤
519       │Availability                 │SUNWcsu                      │
520       └─────────────────────────────┴─────────────────────────────┘
521

SEE ALSO

523       date(1),  lgrpinfo(1),  plgrp(1), proc(1), ps(1), time(2), psrinfo(1M),
524       psrset(1M),   sar(1M),   pset_getloadavg(3C),   proc(4),    project(4),
525       attributes(5), resource_controls(5), zones(5)
526

NOTES

528       The  snapshot  of  system  usage displayed by prstat is true only for a
529       split-second, and it may not be accurate by the time it  is  displayed.
530       When  the  -m  option  is specified, prstat tries to turn on microstate
531       accounting for each process; the original state is restored when prstat
532       exits.  See  proc(4)  for  additional  information about the microstate
533       accounting facility.
534
535
536       The total memory size reported in the SWAP and RSS columns  for  groups
537       of  processes  can  sometimes  overestimate the actual amount of memory
538       used by processes with shared memory segments.
539
540
541
542SunOS 5.11                        25 Jun 2009                       prstat(1M)
Impressum