Using DTrace to understand mpstat output (Doc ID 1278725.1)

Last updated on JULY 29, 2016

Applies to:

Solaris Operating System - Version 10 3/05 and later
Information in this document applies to any platform.

Goal

The mpstat(1m) command reports processor statistics in tabular form. Each row of the table represents the activity of one processor. The first table summarises all activity since boot and should be ignored for the most part. Each subsequent table summarises activity for the preceding interval.

The purpose of this document is to explain the meaning of each column displayed by mpstat(1M) and to provide some helpful DTrace one-liners or scripts that can be used to explain the values/behaviour. This is particularly useful when dealing with a performance problem.

Here's an example of an mpstat output from a two processor system


$ mpstat 1
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0   0    0   0    368  136  269 1    27   0    0   612   1   0   0  99
1   0    0   0    508  258  486 9    28   0    0   1174  1   1   0  98
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0   0   0    0    348  127  243 2    32   2    0   863   2   1   0  97
1   0   0    0    542  283  502 8    31   1    0   784   0   0   0  100
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0   0   0    0    723  437  984 44   120  19 0 6   3690  8   8   0  84
1   0   0    0    457  229 1406 89   115  10 0 2   8133  7   4   0  89


where:


minf   = page faults satisfied from memory
mjf    = page faults satisfied from disk
xcal   = cross calls
intr   = interrupts
ithr   = interrupts threads
csw    = context switches
icsw   = involuntary context switches
migr   = thread migrations
smtx   = spins on mutex locks
srw    = spins on read/writer locks
syscl  = system calls
usr    = CPU time in user mode
sys    = CPU time in kernel mode
wt     = wait on IO
idl    = idle



It's preferable to have the DTraceToolkit on the target system, which can be downloaded from Doc ID 1428139.1. The DTraceToolkit is a collection of over 200 useful and documented DTrace scripts developed by Brendan Gregg.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms