Current File : //usr/man/man1m/mpstat.1m
'\" te
.\" Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights       reserved.
.TH mpstat 1M "9 Sep 2014" "SunOS 5.11" "System Administration Commands"
.SH NAME
mpstat \- report per-processor or per-processor-set statistics
.SH SYNOPSIS
.LP
.nf
\fB/usr/bin/mpstat\fR [\fB-amq\fR] [-A core|soc|\fIbins\fR] [-k keys] [-o num]
     [\fB-p\fR | \fB-P\fR \fIset\fR] [\fB-T\fR d | u] [-I statfile] [-O statfile]
     [\fIinterval\fR [\fIcount\fR]]
.fi

.SH DESCRIPTION
.sp
.LP
The \fBmpstat\fR command reports processor statistics in tabular form. Each row of the table represents the activity of one processor. The first table summarizes all activity since boot. Each subsequent table summarizes activity for the preceding interval. All values are rates listed as events per second unless otherwise noted.
.sp
.LP
During execution of the kernel status command, the \fBstate\fR of the kernel can change. If relevant, a state change message is included in the \fBmpstat\fR output, in one of the following forms:
.sp
.in +2
.nf
<<processor 3 moved from pset: -1 to: 1>>
<<pset destroyed: 1>>
<<pset created: 1>>
<<processors added: 1, 3>>
<<processors removed: 1, 3>>
.fi
.in -2
.sp

.sp
.LP
The \fBmpstat\fR command reports the following information:
.sp
.ne 2
.mk
.na
\fB\fBCPU\fR|\fBSET\fR|\fBCOR\fR|\fBSOC\fR|\fBBIN\fR\fR
.ad
.sp .6
.RS 4n
.sp
.ne 2
.mk
.na
\fB\fBCPU\fR\fR
.ad
.sp .6
.RS 4n
Processor ID for which statistics are shown, when the \fB-a\fR and \fB-A\fR options are omitted.
.RE

.sp
.ne 2
.mk
.na
\fB\fBSET\fR\fR
.ad
.sp .6
.RS 4n
Processor set ID for which statistics are aggregated, for the \fB-a\fR option.
.RE

.sp
.ne 2
.mk
.na
\fB\fBCOR\fR\fR
.ad
.sp .6
.RS 4n
Core ID for which statistics are aggregated, for the \fB-A\fR \fBcore\fR option.
.RE

.sp
.ne 2
.mk
.na
\fB\fBSOC\fR\fR
.ad
.sp .6
.RS 4n
Socket ID for which statistics are aggregated, for the \fB-A\fR \fBsoc\fR option.
.RE

.sp
.ne 2
.mk
.na
\fB\fBBIN\fR\fR
.ad
.sp .6
.RS 4n
Bin ordinal for which statistics are aggregated, for the \fB-A\fR \fIbins\fR option.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBminf\fR\fR
.ad
.sp .6
.RS 4n
minor faults
.RE

.sp
.ne 2
.mk
.na
\fB\fBmjf\fR\fR
.ad
.sp .6
.RS 4n
major faults
.RE

.sp
.ne 2
.mk
.na
\fB\fBxcal\fR\fR
.ad
.sp .6
.RS 4n
inter-processor cross-calls
.RE

.sp
.ne 2
.mk
.na
\fB\fBintr\fR\fR
.ad
.sp .6
.RS 4n
interrupts
.RE

.sp
.ne 2
.mk
.na
\fB\fBithr\fR\fR
.ad
.sp .6
.RS 4n
interrupts as threads (not counting clock interrupt)
.RE

.sp
.ne 2
.mk
.na
\fB\fBcsw\fR\fR
.ad
.sp .6
.RS 4n
context switches
.RE

.sp
.ne 2
.mk
.na
\fB\fBicsw\fR\fR
.ad
.sp .6
.RS 4n
involuntary context switches
.RE

.sp
.ne 2
.mk
.na
\fB\fBmigr\fR\fR
.ad
.sp .6
.RS 4n
thread migrations (to another processor)
.RE

.sp
.ne 2
.mk
.na
\fB\fBsmtx\fR\fR
.ad
.sp .6
.RS 4n
spins on mutexes (lock not acquired on first try)
.RE

.sp
.ne 2
.mk
.na
\fB\fBsrw\fR\fR
.ad
.sp .6
.RS 4n
spins on readers/writer locks (lock not acquired on first try)
.RE

.sp
.ne 2
.mk
.na
\fB\fBsyscl\fR\fR
.ad
.sp .6
.RS 4n
system calls
.RE

.sp
.ne 2
.mk
.na
\fB\fBusr\fR\fR
.ad
.sp .6
.RS 4n
percent user time
.RE

.sp
.ne 2
.mk
.na
\fB\fBsys\fR\fR
.ad
.sp .6
.RS 4n
percent system time
.RE

.sp
.ne 2
.mk
.na
\fB\fBst\fR\fR
.ad
.sp .6
.RS 4n
percent of \fBCPU\fR time which was taken off by the hypervisor. Always zero when running on physical hardware.
.RE

.sp
.ne 2
.mk
.na
\fB\fBidl\fR\fR
.ad
.sp .6
.RS 4n
percent idle time
.RE

.sp
.ne 2
.mk
.na
\fB\fBsze\fR\fR
.ad
.sp .6
.RS 4n
number of processors in the requested processor set
.RE

.sp
.ne 2
.mk
.na
\fB\fBset\fR\fR
.ad
.sp .6
.RS 4n
processor set membership of each \fBCPU\fR
.RE

.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.mk
.na
\fB\fB-a\fR\fR
.ad
.sp .6
.RS 4n
Aggregate output by processor set. Sort the output by set. The default output is sorted by \fBCPU\fR number.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-A\fR \fBcore\fR\fR
.ad
.sp .6
.RS 4n
Aggregate CPU output by core ID. Data rows having the same core ID are aggregated into one row. The columns are replaced with subtotals, by default. The \fB-m\fR option prints column averages, instead.
.sp
The \fB-A\fR option is incompatible with the \fB-a\fR option for aggregating by processor set.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-A\fR \fBsoc\fR\fR
.ad
.sp .6
.RS 4n
Aggregate CPU output by socket ID. Data rows having the same socket ID are aggregated into one row. The columns are replaced with subtotals, by default. The \fB-m\fR option prints column averages, instead.
.sp
The \fB-A\fR option is incompatible with the \fB-a\fR option for aggregating by processor set.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-A\fR \fIbins\fR\fR
.ad
.sp .6
.RS 4n
Aggregate the rows into bins within each sampling period, grouping them in the order in which they appear, and aggregate over rows for each bin. The \fB-k\fR option may be used to change the row order prior to the binning step. The \fBsze\fR column prints the number of CPUs in each bin. The \fBBIN\fR column replaces the \fBCPU\fR column and prints the ordinal of each bin.
.sp
Aggregation by ID (\fB-A\fR \fBcore\fR|\fBsoc\fR) is processed before sorting (\fB-k\fR). Grouping by bins (\fB-A\fR \fIbins\fR) is done next. Finally, the number of output lines printed per interval may be limited by \fB-o\fR.
.sp
The \fB-A\fR option is incompatible with the \fB-a\fR option for aggregating by processor set.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-I\fR \fIstatfile\fR\fR
.ad
.sp .6
.RS 4n
Replay data previously saved in \fIstatfile\fR. Create data files for replay by specifying \fB-O\fR. This option is especially useful for analyzing statistics on machines with large numbers of CPUs. The file may be reprocessed multiple times using different sorting and aggregation options.
.sp
The \fB-I\fR option is incompatible with an interval and count specification.
.sp
Read from the standard input if the file name is \fB\(em\fR (hyphen).
.RE

.sp
.ne 2
.mk
.na
\fB\fB-k\fR \fIkey1\fR,...\fR
.ad
.sp .6
.RS 4n
Sort rows within each sampling period from highest to lowest by \fIkey1\fR, then \fIkey2\fR, and so on. Each key may be any of the column headers such as \fBxcal\fR, \fBintr\fR, \fBsys\fR, and so forth.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-m\fR\fR
.ad
.sp .6
.RS 4n
Print the arithmetic mean value rather than the sum when the \fB-a\fR or \fB-A\fR options are used to aggregate data over multiple CPUs.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-o\fR \fInum\fR\fR
.ad
.sp .6
.RS 4n
Print only the first \fInum\fR rows within each sampling period, after applying sorting and aggregation options.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-O\fR \fIstatfile\fR\fR
.ad
.sp .6
.RS 4n
Save all data to \fIstatfile\fR. This data may be replayed at a later time using \fB-I\fR.
.sp
Write to the standard output if the file name is \fB\(em\fR (hyphen).
.sp
The purpose of \fB-O\fR is to capture all available data. It is incompatible with the data reduction options: \fB-a\fR, \fB-A\fR, \fB-k\fR, \fB-m\fR, \fB-o\fR, \fB-p\fR, and \fB-P\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-p\fR\fR
.ad
.sp .6
.RS 4n
Report processor set membership of each \fBCPU\fR. Sort the output by set. The default output is sorted by \fBCPU\fR number.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-P\fR \fIset\fR\fR
.ad
.sp .6
.RS 4n
Display only those processors in the specified \fIset\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-q\fR\fR
.ad
.sp .6
.RS 4n
Suppress messages related to state changes.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-T\fR \fBu\fR | \fBd\fR\fR
.ad
.sp .6
.RS 4n
Specify \fBu\fR for a printed representation of the internal representation of time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See \fBdate\fR(1).
.RE

.sp
.ne 2
.mk
.na
\fB\fIinterval\fR\fR
.ad
.sp .6
.RS 4n
Report once each \fIinterval\fR seconds.
.RE

.sp
.ne 2
.mk
.na
\fB\fIcount\fR\fR
.ad
.sp .6
.RS 4n
Only print \fIcount\fR reports.
.RE

.SH EXAMPLES
.sp
.LP
On displays of 80-character width, example output below wraps by one to seven characters. By making a window wider, you can eliminate this wrap.
.LP
\fBExample 1 \fRUsing \fBmpstat\fR to Generate User and System Operation Statistics
.sp
.LP
The following command generates processor statistics over a five-second interval in two reports. The command shows the processor set membership of each \fBCPU\fR. The default output is sorted by \fBCPU\fR number, aggregated by \fIprocessor set\fR, for user (\fBusr\fR) and system (\fBsys\fR) operations.

.sp
.in +2
.nf
example% \fBmpstat -ap 5 2\fR


SET minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys st idl sze
  0    6   0  355  291  190  22    0    0    0   0    43   0   2  0  43   1
  1   24  17  534  207  200  70    1    0    2   0   600   4   1  1  83   2
  2   19   7  353  325  318  44    0    0    5   0   345   1   1  0  94   3
  3   36   2  149  237  236  14    0    0    4   0    97   0   0  0  98   2
SET minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys st idl sze
  0    1   0  720  405  304  55    0    0   18   0    12   0  15  0  81   1
  1    0  69 1955  230  200 313   33    4   41   9  7086  34  10  0  19   2
  2    0  46  685  314  300 203   11    0   54   1  5287  36   6  2  26   3
  3    0   0   14  386  384   0    0    0    0   0     0   0   0  0 100   2
.fi
.in -2
.sp

.LP
\fBExample 2 \fRDisplaying CPUs That Meet Filter Requirement
.sp
.LP
The following command displays the three CPUs with the highest \fBintr\fR rates.

.sp
.in +2
.nf
example% \fBmpstat -k intr -o 3\fR
CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  st idl
 56 1143   5  975  4238   82  465   74   53  124    0 198163  42  17   1  40
123 1189   6 1315  1030  890  461   65   53  122    0 24383   27  12   0  62
  4 1184   5 1040   149   70  502   73   55  113    0 82039   31  13   0  56
.fi
.in -2
.sp

.LP
\fBExample 3 \fRAggregating Multiple CPUs into Quartiles
.sp
.LP
The following command aggregates 256 CPUs into quartiles by \fBsys\fR time.

.sp
.in +2
.nf
example% \fBmpstat -A 4 -k sys\fR
BIN minf mjf xcal intr ithr  csw icsw migr smtx  srw syscl  usr sys  st idl sze

0   18   0 5811  7105    1 22154   17 9529 1176   0    72    1  79   1  18  64
1    0   0 4624  1006   12 1321   42  418  175    0  3591   36  37   0  27  64
2 1195   5 1056    92   10  526   74   56  104    0 45876   27  12   0  61  64
3    0   0    2    18    8   10    0    0    0    0     1    0   0   0 100  64
.fi
.in -2
.sp

.LP
\fBExample 4 \fRSaving Statistics for Later Reprocessing
.sp
.LP
The following command saves statistics for later reprocessing and aggregates by core ID on a machine with eight CPUs per core.

.sp
.in +2
.nf
example% \fBmpstat -O /tmp/t1; mpstat -I /tmp/t1 -A core\fR
COR minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  st idl sze
514    0   0  124    45    0   21    0    3    1    0     0    0   3   0  97   8
521    0   0   16     5    0    1    0    0    0    0     0    0   0   1  99   8
528    0   0   11     5    0    3    0    0    0    0     0    0   0   0 100   8
535    0   0    7     4    0    1    0    0    0    0     0    0   0   0 100   8
542    0   0    7     4    0    1    0    0    0    0     0    0   0   0 100   8
549    0   0   10     4    0    1    0    0    0    0     0    0   0   0 100   8
556    0   0   10     5    0    1    0    0    0    0     0    0   0   0 100   8
563    0   0    8     4    0    1    0    0    0    0     0    0   0   0 100   8
.fi
.in -2
.sp

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i) 
lw(2.75i) |lw(2.75i) 
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Availabilitysystem/core-os
_
Interface StabilitySee below.
.TE

.sp
.LP
Invocation is evolving. Human readable output is unstable.
.SH SEE ALSO
.sp
.LP
\fBsar\fR(1), \fBdate\fR(1), \fBiostat\fR(1M), \fBsar\fR(1M), \fBvmstat\fR(1M), \fBtime\fR(2), \fBattributes\fR(5)
.SH NOTES
.sp
.LP
The sum of \fBCPU\fR utilization might vary slightly from 100 due to rounding errors in the production of a percentage figure.
.sp
.LP
The total time used for \fBCPU\fR processing is the sum of \fBusr\fR and \fBsys\fR output values, reported for user and system operations. The \fBidl\fR value reports the time that the \fBCPU\fR is idle for any reason other than pending disk I/O operations. 
.sp
.LP
Run the \fBiostat\fR command with the \fB-x\fR option to report I/O service times in \fBsvc_t\fR output. The \fBiostat\fR utility also reports the same \fBst\fR, user (\fBus\fR), and system (\fBsy\fR) statistics. See \fBiostat\fR(1M) for more information.
.sp
.LP
When executing in a \fBzone\fR and if the pools facility is active, \fBmpstat\fR(1M) will only provide information for those processors which are a member of the processor set of the pool to which the \fBzone\fR is bound.