1 PRSTAT(1M)                   Maintenance Commands                   PRSTAT(1M)
   2 
   3 
   4 
   5 NAME
   6        prstat - report active process statistics
   7 
   8 SYNOPSIS
   9        prstat [-acHJLmRrtTvWZ] [-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]
  13             [interval [count]]
  14 
  15 
  16 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
  24        arguments. Items in a list can be either separated by commas or
  25        enclosed in 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 
  31 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.  Long names are not truncated in this mode.
  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
  53            pset_getloadavg(3C)). Processes with one or more LWPs bound to
  54            processor sets in the given list are reported even when the -L
  55            option is not used.
  56 
  57 
  58        -d u | d
  59 
  60            Specify u for a printed representation of the internal
  61            representation of time. See time(2). Specify d for standard date
  62            format. See date(1).
  63 
  64 
  65        -h lgrplist
  66 
  67            Report only processes or lwps whose home lgroup is in the given
  68            list of lgroups. No processes or lwps will be listed for invalid
  69            lgroups.
  70 
  71 
  72        -H
  73 
  74            Report information about home lgroup. In this mode, prstat adds an
  75            extra column showing process or lwps home lgroup with the header
  76            LGRP.
  77 
  78 
  79        -j projlist
  80 
  81            Report only processes or lwps whose project ID is in the given
  82            list. Each project ID can be specified as either a project name or
  83            a numerical project ID. See project(4).
  84 
  85 
  86        -J
  87 
  88            Report information about processes and projects. In this mode
  89            prstat displays separate reports about processes and projects at
  90            the same time.  A trailing asterisk marks a long name that has been
  91            truncated to fit the column.
  92 
  93 
  94        -k tasklist
  95 
  96            Report only processes or lwps whose task ID is in tasklist.
  97 
  98 
  99        -L
 100 
 101            Report statistics for each light-weight process (LWP). By default,
 102            prstat reports only the number of LWPs for each process.
 103 
 104 
 105        -m
 106 
 107            Report microstate process accounting information. In addition to
 108            all fields listed in -v mode, this mode also includes the
 109            percentage of time the process has spent processing system traps,
 110            text page faults, data page faults, waiting for user locks and
 111            waiting for CPU (latency time).
 112 
 113 
 114        -n ntop[,nbottom]
 115 
 116            Restrict number of output lines. The ntop argument determines how
 117            many lines of process or lwp statistics are reported, and the
 118            nbottom argument determines how many lines of user, task, project
 119            or zone statistics are reported if the -a, -t, -T, -J or -Z options
 120            are specified. By default, prstat displays as many lines of output
 121            that fit in a window or terminal. When you specify the -c option or
 122            direct the output to a file, the default values for ntop and
 123            nbottom are 15 and 5.
 124 
 125 
 126        -p pidlist
 127 
 128            Report only processes whose process ID is in the given list.
 129 
 130 
 131        -P cpulist
 132 
 133            Report only processes or lwps which have most recently executed on
 134            a CPU in the given list. Each CPU is identified by an integer as
 135            reported by psrinfo(1M).
 136 
 137 
 138        -R
 139 
 140            Put prstat in the real time scheduling class. When this option is
 141            used, prstat is given priority over time-sharing and interactive
 142            processes.  This option is available only for superuser.
 143 
 144 
 145        -r
 146 
 147            Disable lookups for user names and project names. (Note that this
 148            does not apply to lookups for the -j, -u, or -U options.)
 149 
 150 
 151        -s key
 152 
 153            Sort output lines (that is, processes, lwps, or users) by key in
 154            descending order. Only one key can be used as an argument.
 155 
 156            There are five possible key values:
 157 
 158            cpu
 159 
 160                Sort by process CPU usage. This is the default.
 161 
 162 
 163            pri
 164 
 165                Sort by process priority.
 166 
 167 
 168            rss
 169 
 170                Sort by resident set size.
 171 
 172 
 173            size
 174 
 175                Sort by size of process image.
 176 
 177 
 178            time
 179 
 180                Sort by process execution time.
 181 
 182 
 183 
 184        -S key
 185 
 186            Sort output lines by key in ascending order. Possible key values
 187            are the same as for the -s option. See -s.
 188 
 189 
 190        -t
 191 
 192            Report total usage summary for each user. The summary includes the
 193            total number of processes or LWPs owned by the user, total size of
 194            process images, total resident set size, total cpu time, and
 195            percentages of recent cpu time and system memory.
 196 
 197 
 198        -T
 199 
 200            Report information about processes and tasks. In this mode prstat
 201            displays separate reports about processes and tasks at the same
 202            time.
 203 
 204 
 205        -u euidlist
 206 
 207            Report only processes whose effective user ID is in the given list.
 208            Each user ID may be specified as either a login name or a numerical
 209            user ID.
 210 
 211 
 212        -U uidlist
 213 
 214            Report only processes whose real user ID is in the given list. Each
 215            user ID may be specified as either a login name or a numerical user
 216            ID.
 217 
 218 
 219        -v
 220 
 221            Report verbose process usage. This output format includes the
 222            percentage of time the process has spent in user mode, in system
 223            mode, and sleeping. It also includes the number of voluntary and
 224            involuntary context switches, system calls and the number of
 225            signals received. Statistics that are not reported are marked with
 226            the - sign.
 227 
 228 
 229        -W
 230 
 231            Truncate long names even when prstat would normally print them in
 232            full.  A trailing asterisk marks a long name that has been
 233            truncated to fit the column.
 234 
 235 
 236        -z zoneidlist
 237 
 238            Report only processes or LWPs whose zone ID is in the given list.
 239            Each zone ID can be specified as either a zone name or a numerical
 240            zone ID. See zones(5).
 241 
 242 
 243        -Z
 244 
 245            Report information about processes and zones. In this mode, prstat
 246            displays separate reports about processes and zones at the same
 247            time.  A trailing asterisk marks a long name that has been
 248            truncated to fit the column.
 249 
 250 
 251 OUTPUT
 252        The following list defines the column headings and the meanings of a
 253        prstat report:
 254 
 255        PID
 256 
 257            The process ID of the process.
 258 
 259 
 260        USERNAME
 261 
 262            The real user (login) name or real user ID.  A trailing asterisk
 263            marks a long name that has been truncated to fit the column.
 264 
 265 
 266        SWAP
 267 
 268            The total virtual memory size of the process, including all mapped
 269            files and devices, in kilobytes (K), megabytes (M), or gigabytes
 270            (G).
 271 
 272 
 273        RSS
 274 
 275            The resident set size of the process (RSS), in kilobytes (K),
 276            megabytes (M), or gigabytes (G). The RSS value is an estimate
 277            provided by proc(4) that might underestimate the actual resident
 278            set size. Users who want to get more accurate usage information for
 279            capacity planning should use the -x option to pmap(1) instead.
 280 
 281 
 282        STATE
 283 
 284            The state of the process:
 285 
 286            cpuN
 287 
 288                Process is running on CPU N.
 289 
 290 
 291            sleep
 292 
 293                Sleeping: process is waiting for an event to complete.
 294 
 295 
 296            wait
 297 
 298                Waiting: process is waiting for CPU usage to drop to the CPU-
 299                caps enforced limits. See the description of CPU-caps in
 300                resource_controls(5).
 301 
 302 
 303            run
 304 
 305                Runnable: process in on run queue.
 306 
 307 
 308            zombie
 309 
 310                Zombie state: process terminated and parent not waiting.
 311 
 312 
 313            stop
 314 
 315                Process is stopped.
 316 
 317 
 318 
 319        PRI
 320 
 321            The priority of the process. Larger numbers mean higher priority.
 322 
 323 
 324        NICE
 325 
 326            Nice value used in priority computation. Only processes in certain
 327            scheduling classes have a nice value.
 328 
 329 
 330        TIME
 331 
 332            The cumulative execution time for the process.
 333 
 334 
 335        CPU
 336 
 337            The percentage of recent CPU time used by the process. If executing
 338            in a non-global zone and the pools facility is active, the
 339            percentage will be that of the processors in the processor set in
 340            use by the pool to which the zone is bound.
 341 
 342 
 343        PROCESS
 344 
 345            The name of the process (name of executed file).
 346 
 347 
 348        LWP
 349 
 350            The lwp ID of the lwp being reported, as well as the LWP name if
 351            any is set.
 352 
 353 
 354        NLWP
 355 
 356            The number of lwps in the process.
 357 
 358 
 359 
 360        With the some options, in addition to a number of the column headings
 361        shown above, there are:
 362 
 363        NPROC
 364 
 365            Number of processes in a specified collection.
 366 
 367 
 368        MEMORY
 369 
 370            Percentage of memory used by a specified collection of processes.
 371 
 372 
 373 
 374        The following columns are displayed when the -v or -m option is
 375        specified
 376 
 377        USR
 378 
 379            The percentage of time the process has spent in user mode.
 380 
 381 
 382        SYS
 383 
 384            The percentage of time the process has spent in system mode.
 385 
 386 
 387        TRP
 388 
 389            The percentage of time the process has spent in processing system
 390            traps.
 391 
 392 
 393        TFL
 394 
 395            The percentage of time the process has spent processing text page
 396            faults.
 397 
 398 
 399        DFL
 400 
 401            The percentage of time the process has spent processing data page
 402            faults.
 403 
 404 
 405        LCK
 406 
 407            The percentage of time the process has spent waiting for user
 408            locks.
 409 
 410 
 411        SLP
 412 
 413            The percentage of time the process has spent sleeping.
 414 
 415 
 416        LAT
 417 
 418            The percentage of time the process has spent waiting for CPU.
 419 
 420 
 421        VCX
 422 
 423            The number of voluntary context switches.
 424 
 425 
 426        ICX
 427 
 428            The number of involuntary context switches.
 429 
 430 
 431        SCL
 432 
 433            The number of system calls.
 434 
 435 
 436        SIG
 437 
 438            The number of signals received.
 439 
 440 
 441 
 442        Under the -L option, one line is printed for each lwp in the process
 443        and some reporting fields show the values for the lwp, not the process.
 444 
 445 
 446        The following column is displayed when the -H option is specified:
 447 
 448        LGRP
 449 
 450            The home lgroup of the process or lwp.
 451 
 452 
 453 OPERANDS
 454        The following operands are supported:
 455 
 456        count
 457 
 458            Specifies the number of times that the statistics are repeated. By
 459            default, prstat reports statistics until a termination signal is
 460            received.
 461 
 462 
 463        interval
 464 
 465            Specifies the sampling interval in seconds; the default interval is
 466            5 seconds.
 467 
 468 
 469 EXAMPLES
 470        Example 1 Reporting the Five Most Active Super-User Processes
 471 
 472 
 473        The following command reports the five most active super-user processes
 474        running on CPU1 and CPU2:
 475 
 476 
 477          example% prstat -u root -n 5 -P 1,2 1 1
 478 
 479          PID   USERNAME  SWAP   RSS STATE  PRI  NICE      TIME  CPU PROCESS/LWP
 480           306   root     3024K 1448K sleep   58    0   0:00.00 0.3% sendmail/1
 481           102   root     1600K  592K sleep   59    0   0:00.00 0.1% in.rdisc/1
 482           250   root     1000K  552K sleep   58    0   0:00.00 0.0% utmpd/1
 483           288   root     1720K 1032K sleep   58    0   0:00.00 0.0% sac/1
 484             1   root      744K  168K sleep   58    0   0:00.00 0.0% init/1
 485          TOTAL:       25, load averages:  0.05, 0.08, 0.12
 486 
 487 
 488 
 489        Example 2 Displaying Verbose Process Usage Information
 490 
 491 
 492        The following command displays verbose process usage information about
 493        processes with lowest resident set sizes owned by users root and john.
 494 
 495 
 496          example% prstat -S rss -n 5 -vc -u root,john
 497 
 498           PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/LWP
 499             1 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 init/1
 500           102 root     0.0 0.0  -   -   -   -  100  -    0   0   3   0 in.rdisc/1
 501           250 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 utmpd/1
 502          1185 john    0.0 0.0  -   -   -   -  100  -    0   0   0   0 csh/1
 503           240 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 powerd/4
 504           TOTAL:       71, load averages:  0.02, 0.04, 0.08
 505 
 506 
 507 
 508 
 509 EXIT STATUS
 510        The following exit values are returned:
 511 
 512        0
 513 
 514            Successful completion.
 515 
 516 
 517        1
 518 
 519            An error occurred.
 520 
 521 
 522 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 
 527 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 
 542                                September 1, 2018                    PRSTAT(1M)