mpstat – Display basic info about processors related statistics, here is the version I used for following examples:

 mpstat -V
sysstat version 10.1.5
(C) Sebastien Godard (sysstat <at> orange.fr)

Display default CPU statistics

By default mpstat displays CPU statistics as shown below.

# mpstat
Linux 3.10.0-327.28.3.el7.x86_64 (fibrevillage.com)     09/19/16     _x86_64_    (4 CPU)

23:45:28     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
23:45:28     all    1.35    0.00    0.11    0.61    0.00    0.01    0.00    0.00    0.00   97.93

mpstat – Display all information

Option -A, displays all the information that can be displayed by the mpstat command as shown below.

This is really equalivalent to “mpstat -I ALL -u -P ALL” command.

# mpstat -A
Linux 3.10.0-327.28.3.el7.x86_64 (fibrevillage.com)     09/19/16     _x86_64_    (4 CPU)

23:47:10     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
23:47:10     all    1.35    0.00    0.11    0.61    0.00    0.01    0.00    0.00    0.00   97.93
23:47:10       0    2.11    0.00    0.10    0.57    0.00    0.01    0.00    0.00    0.00   97.21
23:47:10       1    1.11    0.00    0.09    0.71    0.00    0.01    0.00    0.00    0.00   98.08
23:47:10       2    1.08    0.00    0.13    0.47    0.00    0.01    0.00    0.00    0.00   98.31
23:47:10       3    1.08    0.00    0.11    0.69    0.00    0.01    0.00    0.00    0.00   98.10

23:47:10     CPU    intr/s
23:47:10     all    409.84
23:47:10       0     79.38
23:47:10       1     76.20
23:47:10       2     99.47
23:47:10       3     68.52

23:47:10     CPU        0/s        1/s        8/s        9/s       12/s       16/s       19/s       20/s       21/s       27/s      NMI/s      LOC/s      SPU/s      PMI/s      IWI/s      RTR/s      RES/s      CAL/s      TLB/s      TRM/s      THR/s      MCE/s      MCP/s      ERR/s      MIS/s
23:47:10       0       0.00       0.00       0.00       0.00       0.00       3.64       0.00       0.00       0.00       0.14       0.02      68.30       0.00       0.02       2.10       0.00      27.02       0.00       1.49       0.00       0.00       0.00       0.00       0.00       0.00
23:47:10       1       0.00       0.00       0.00       0.00       0.00       0.00       0.00       0.00       0.00       0.15       0.01      65.40       0.00       0.01       1.33       0.00      25.69       1.85       1.37       0.00       0.00       0.00       0.00       0.00       0.00
23:47:10       2       0.00       0.00       0.00       0.00       0.00       2.86       0.00       0.00       0.00      27.45       0.01      60.96       0.00       0.01       2.78       0.00      25.66       0.00       1.52       0.00       0.00       0.00       0.00       0.00       0.00
23:47:10       3       0.00       0.00       0.00       0.00       0.00       0.00       0.00       0.00       0.00       0.15       0.01      59.79       0.00       0.01       1.37       0.00      25.49       1.70       1.46       0.00       0.00       0.00       0.00       0.00       0.00

23:47:10     CPU       HI/s    TIMER/s   NET_TX/s   NET_RX/s    BLOCK/s BLOCK_IOPOLL/s  TASKLET/s    SCHED/s  HRTIMER/s      RCU/s
23:47:10       0       0.00      38.69       0.20      15.91       1.66       0.00       0.00      14.10       0.00       8.82
23:47:10       1       0.00      32.55       0.00      17.42       1.85       0.00       0.00      17.23       0.00       7.14
23:47:10       2       0.00      30.97       0.00      44.02       1.30       0.00       0.59      14.98       0.00       7.62
23:47:10       3       0.00      28.56       0.00      17.72       1.70       0.00       0.00      13.69       0.00       6.85

mpstat – Display CPU statistics of individual CPU (or) Core

Option -P ALL, displays all the individual CPUs (or Cores) along with its statistics as shown below.

# mpstat -P ALL
Linux 3.10.0-327.28.3.el7.x86_64 (fibrevillage.com)     09/19/16     _x86_64_    (4 CPU)

23:48:47 CPU %usr %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
23:48:47 all 1.35 0.00    0.11    0.61    0.00    0.01    0.00    0.00    0.00   97.93
23:48:47   0 2.11 0.00    0.10    0.57    0.00    0.01    0.00    0.00    0.00   97.21
23:48:47  1 1.11 0.00    0.09    0.71    0.00    0.01    0.00    0.00    0.00   98.08
23:48:47   2 1.08 0.00    0.13    0.47    0.00    0.01    0.00    0.00    0.00   98.31
23:48:47   3 1.08 0.00    0.11    0.69    0.00    0.01    0.00    0.00    0.00   98.10

Display statistics information of a particular CPU (or core)

Use option -P as shown below.

# mpstat -P 0
Linux 3.10.0-327.28.3.el7.x86_64 (fibrevillage.com)     09/19/16     _x86_64_    (4 CPU)

23:50:24     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
23:50:24       0    2.11    0.00    0.10    0.57    0.00    0.01    0.00    0.00    0.00   97.21

Display statistics information of interrupts

# mpstat -I SUM
Linux 3.10.0-327.28.3.el7.x86_64 (fibrevillage.com)     09/19/16     _x86_64_    (4 CPU)

23:52:08     CPU    intr/s
23:52:08     all    409.84

Where, -I option has 4 sub options:

 

-I { SUM | CPU | SCPU | ALL }
    Report interrupts statistics.
     With the SUM keyword, the mpstat command reports the total number of interrupts per processor.
  The following values are displayed:
      CPU
         Processor number. The keyword all indicates that statistics are calculated as averages
among all processors.
      intr/s
         Show the total number of interrupts received per second by the CPU or CPUs.
      With the CPU keyword, the number of each individual interrupt received per second  by  the 
CPU  or CPUs is displayed.
      With  the SCPU keyword, the number of each individual software interrupt received per second
by the CPU or CPUs is displayed. This option works only with kernels 2.6.31 and later.
      The ALL keyword is equivalent to specifying all the keywords above and therefore all the
interrupts statistics are displayed.

Display CPU utilization

# mpstat -u
Linux 3.10.0-327.28.3.el7.x86_64 (fibrevillage.com)     09/20/16     _x86_64_    (4 CPU)

00:05:40     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
00:05:40     all    1.35    0.00    0.11    0.61    0.00    0.01    0.00    0.00    0.00   97.93