| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 1M: System Administration Commands Oracle Solaris 11 Information Library |
- report active process statistics
prstat [-acHJLmRrtTv] [-d u | d] [-Cpsrsetlist] [-hlgrplist] [-jprojlist] [-ktasklist] [-nntop[,nbottom]] [-ppidlist] [-Pcpulist] [-skey |-Skey ] [-ueuidlist] [-Uuidlist] [-zzoneidlist] [-Z] [interval [count]]
Theprstat utility iteratively examines all active processes on the system andreports statistics based on the selected output mode and sort order.prstatprovides options to examine only processes matching specified PIDs, UIDs, zone IDs, CPUIDs, and processor set IDs.
The-j,-k,-C,-p,-P,-u,-U, and-z options acceptlists as arguments. Items in a list can be either separated bycommas or enclosed in quotes and separated by commas or spaces.
If you do not specify an option,prstat examines all processes andreports statistics sorted by CPU usage.
The following options are supported:
Report information about processes and users. In this modeprstat displays separate reports about processes and users at the same time.
Print new reports below previous reports instead of overprinting them.
Report only processes or lwps that are bound to processor sets in the given list. Each processor set is identified by an integer as reported bypsrset(1M). The load averages displayed are the sum of the load averages of the specified processor sets (seepset_getloadavg(3C)). Processes with one or more LWPs bound to processor sets in the given list are reported even when the-L option is not used.
Specifyu for a printed representation of the internal representation of time. Seetime(2). Specifyd for standard date format. Seedate(1).
Report only processes or lwps whose homelgroup is in the given list oflgroups. No processes or lwps will be listed for invalidlgroups.
Report information about homelgroup. In this mode,prstat adds an extra column showing process or lwps homelgroup with the header LGRP.
Report only processes or lwps whose project ID is in the given list. Each project ID can be specified as either a project name or a numerical project ID. Seeproject(4).
Report information about processes and projects. In this modeprstat displays separate reports about processes and projects at the same time.
Report only processes or lwps whose task ID is intasklist.
Report statistics for each light-weight process (LWP). By default,prstat reports only the number of LWPs for each process.
Report microstate process accounting information. In addition to all fields listed in-v mode, this mode also includes the percentage of time the process has spent processing system traps, text page faults, data page faults, waiting for user locks and waiting for CPU (latency time).
Restrict number of output lines. Thentop argument determines how many lines of process orlwp statistics are reported, and thenbottom argument determines how many lines of user, task, or projects statistics are reported if the-a,-t,-T,-J or-Z options are specified. By default,prstat displays as many lines of output that fit in a window or terminal. When you specify the-c option or direct the output to a file, the default values forntop andnbottom are15 and5.
Report only processes whose process ID is in the given list.
Report only processes or lwps which have most recently executed on a CPU in the given list. Each CPU is identified by an integer as reported bypsrinfo(1M).
Putprstat in the real time scheduling class. When this option is used,prstat is given priority over time-sharing and interactive processes. This option is available only for superuser.
Disable lookups for user names and project names. (Note that this does not apply to lookups for the-j,-u, or-U options.)
Sort output lines (that is, processes,lwps, or users) bykey in descending order. Only onekey can be used as an argument.
There are five possible key values:
Sort by process CPU usage. This is the default.
Sort by process priority.
Sort by resident set size.
Sort by size of process image.
Sort by process execution time.
Sort output lines bykey in ascending order. Possiblekey values are the same as for the-s option. See-s.
Report total usage summary for each user. The summary includes the total number of processes or LWPs owned by the user, total size of process images, total resident set size, total cpu time, and percentages of recent cpu time and system memory.
Report information about processes and tasks. In this modeprstat displays separate reports about processes and tasks at the same time.
Report only processes whose effective user ID is in the given list. Each user ID may be specified as either a login name or a numerical user ID.
Report only processes whose real user ID is in the given list. Each user ID may be specified as either a login name or a numerical user ID.
Report verbose process usage. This output format includes the percentage of time the process has spent in user mode, in system mode, and sleeping. It also includes the number of voluntary and involuntary context switches, system calls and the number of signals received. Statistics that are not reported are marked with the- sign.
Report only processes or LWPs whose zone ID is in the given list. Each zone ID can be specified as either a zone name or a numerical zone ID. Seezones(5).
Report information about processes and zones. In this mode,prstat displays separate reports about processes and zones at the same time.
The following list defines the column headings and the meanings of aprstat report:
The process ID of the process.
The real user (login) name or real user ID.
The sum of swap reservations of the associated processes for each user, project, task, or zone. This counts shared memory only once for each user, project, task, or zone. Swap is reserved when anonymous memory is allocated or files are mapped private. The value of swap is expressed in kilobytes (K), megabytes (M), or gigabytes (G).
The resident set size of the process (RSS), in kilobytes (K), megabytes (M), or gigabytes (G). The RSS value is an estimate provided byproc(4) that might underestimate the actual resident set size. Users who want to get more accurate usage information for capacity planning should use the-x option topmap(1) instead.
The state of the process:
Process is running on CPUN.
Sleeping: process is waiting for an event to complete.
Waiting: process is waiting for CPU usage to drop to the CPU-caps enforced limits. See the description ofCPU-caps inresource_controls(5).
Runnable: process in on run queue.
Zombie state: process terminated and parent not waiting.
Process is stopped.
The priority of the process. Larger numbers mean higher priority.
Nice value used in priority computation. Only processes in certain scheduling classes have a nice value.
The cumulative execution time for the process.
The percentage of recent CPU time used by the process. If executing in a non-globalzone and the pools facility is active, the percentage will be that of the processors in the processor set in use by the pool to which thezone is bound.
The name of the process (name of executed file).
Thelwp ID of thelwp being reported.
The number oflwps in the process.
With the some options, in addition to a number of the columnheadings shown above, there are:
Number of processes in a specified collection.
Percentage of memory used by a specified collection of processes.
The following columns are displayed when the-v or-m option isspecified
The percentage of time the process has spent in user mode.
The percentage of time the process has spent in system mode.
The percentage of time the process has spent in processing system traps.
The percentage of time the process has spent processing text page faults.
The percentage of time the process has spent processing data page faults.
The percentage of time the process has spent waiting for user locks.
The percentage of time the process has spent sleeping.
The percentage of time the process has spent waiting for CPU.
The number of voluntary context switches.
The number of involuntary context switches.
The number of system calls.
The number of signals received.
Under the-L option, one line is printed for eachlwp inthe process and some reporting fields show the values for thelwp,not the process.
The following column is displayed when the-H option is specified:
The homelgroup of the process or lwp.
The following operands are supported:
Specifies the number of times that the statistics are repeated. By default,prstat reports statistics until a termination signal is received.
Specifies the sampling interval in seconds; the default interval is5 seconds.
Example 1 Reporting the Five Most Active Super-User Processes
The following command reports the five most active super-user processes running onCPU1 andCPU2:
example% prstat -u root -n 5 -P 1,2 1 1PID USERNAME SWAP RSS STATE PRI NICE TIME CPU PROCESS/LWP 306 root 3024K 1448K sleep 58 0 0:00.00 0.3% sendmail/1 102 root 1600K 592K sleep 59 0 0:00.00 0.1% in.rdisc/1 250 root 1000K 552K sleep 58 0 0:00.00 0.0% utmpd/1 288 root 1720K 1032K sleep 58 0 0:00.00 0.0% sac/1 1 root 744K 168K sleep 58 0 0:00.00 0.0% init/1TOTAL: 25, load averages: 0.05, 0.08, 0.12
Example 2 Displaying Verbose Process Usage Information
The following command displays verbose process usage information about processes with lowestresident set sizes owned by usersroot andjohn.
example% prstat -S rss -n 5 -vc -u root,john PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/LWP 1 root 0.0 0.0 - - - - 100 - 0 0 0 0 init/1 102 root 0.0 0.0 - - - - 100 - 0 0 3 0 in.rdisc/1 250 root 0.0 0.0 - - - - 100 - 0 0 0 0 utmpd/11185 john 0.0 0.0 - - - - 100 - 0 0 0 0 csh/1 240 root 0.0 0.0 - - - - 100 - 0 0 0 0 switchd/4 TOTAL: 71, load averages: 0.02, 0.04, 0.08
The following exit values are returned:
Successful completion.
An error occurred.
Seeattributes(5) for descriptions of the following attributes:
|
date(1),lgrpinfo(1),plgrp(1),proc(1),ps(1),time(2),psrinfo(1M),psrset(1M),sar(1M),pset_getloadavg(3C),proc(4),project(4),attributes(5),resource_controls(5),zones(5)
The snapshot of system usage displayed byprstat is true only fora split-second, and it may not be accurate by the time itis displayed. When the-m option is specified,prstat tries to turnon microstate accounting for each process; the original state is restored whenprstatexits. Seeproc(4) for additional information about the microstate accounting facility.
The total memory size reported in the SWAP and RSS columns forgroups of processes can sometimes overestimate the actual amount of memory usedby processes with shared memory segments.
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |