Page MenuHomeFreeBSD

Make `iostat -xC` print CPU information on its own line
ClosedPublic

Authored by allanjude on Apr 15 2018, 5:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 3:09 PM
Unknown Object (File)
Sep 30 2024, 7:02 AM
Unknown Object (File)
Sep 27 2024, 3:12 AM
Unknown Object (File)
Sep 24 2024, 4:13 AM
Unknown Object (File)
Sep 20 2024, 6:01 AM
Unknown Object (File)
Sep 13 2024, 7:44 AM
Unknown Object (File)
Sep 5 2024, 9:18 AM
Unknown Object (File)
Sep 5 2024, 8:52 AM
Subscribers

Details

Summary

In illumos, the equivelent command iostat -xc returns a much nicer format

Before:

 # iostat -xC 1
                        extended device statistics             cpu
device       r/s     w/s     kr/s     kw/s  ms/r  ms/w  ms/o  ms/t qlen  %b  us ni sy in id
da0          306     372   9924.7  12134.0     2     3     0     2    1  78   0  0  3  0 97
da1            0       0     28.3      0.3    19    13     0    18    0   1
da2            0       0      0.1      0.0     2     0     0     2    0   0

illumos:

# iostat -xnc 1
    cpu
us sy dt id
10  6  0 84
                   extended device statistics
   r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b device
   0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 fd0
   0.5    1.2   31.4    9.1  0.1  0.0   54.5    4.8   0   1 filepool
   0.0    8.9    0.7  111.3  0.4  0.1   48.6    8.7   1   6 rpool
   0.0    0.1    0.0    0.0  0.0  0.0    0.0    0.0   0   0 c1t0d0
   0.0    0.1    0.0    0.0  0.0  0.0    0.0    0.0   0   0 c1t1d0

After:

 # iostat -xC 1
      cpu
 us ni sy in id
  0  0  0  0 100
                        extended device statistics
device       r/s     w/s     kr/s     kw/s  ms/r  ms/w  ms/o  ms/t qlen  %b
da0            0       0      0.0      0.0     0     0     0     0    0   0
da1            0       0      0.0      0.0     0     0     0     0    0   0
da2            0       0      0.0      0.0     0     0     0     0    0   0

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

allanjude edited the summary of this revision. (Show Details)
allanjude edited the summary of this revision. (Show Details)

Fix alignment of the cpu header

Spotted by mjg

I agree, this looks like a better way to do it. It may break anyone who has scripts built to parse the output of iostat -xC, but I doubt there are many people doing that.

This revision is now accepted and ready to land.Apr 17 2018, 3:37 PM
This revision was automatically updated to reflect the committed changes.