fix attached.
 
 
This message posted from opensolaris.org
-------------- next part --------------
bugid   : 6207437
synopsis: iostat should display merged results.
path    : /solarisws/usr/src/cmd/stat/iostat


According to 'man iostat'-->

"       > The svc_t response time is not particularly significant when
        > the  I/0  (r/s+w/s) rates are under 0.5 per second. Harmless
        > spikes are fairly normal in such cases.
"

i just added a merged response("header io") in the beggining.
each time the pgm adds r/s and w/s and print it as i/o.

-------------------------------------------------------------------------------
bash-3.00# diff -u iostat.c.orig iostat.c
--- iostat.c.org        Tue Oct  2 20:15:57 2007
+++ iostat.c    Thu Jan 10 02:24:48 2008
@@ -801,25 +801,25 @@
                if (doit) {
                        if (!do_conversions) {
                                if (do_raw == 0) {
-                                       fstr = " %6.1f %6.1f %6.1f %6.1f "
+                                       fstr = " %6.1f %6.1f %6.1f %6.1f %6.1f "
                                                "%4.1f %4.1f %6.1f %3.0f "
                                                "%3.0f ";
                                } else {
                                        fstr = "%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,"
-                                               "%.1f,%.0f,%.0f";
+                                               "%.1f,%.0f,%.0f,%.1f";
                                }
-                               push_out(fstr, rps, wps, krps, kwps, avw, avr,
+                               push_out(fstr, rps+wps, rps, wps, krps, kwps, 
avw, avr,
                                    serv, w_pct, r_pct);
                        } else {
                                if (do_raw == 0) {
-                                       fstr = " %6.1f %6.1f %6.1f %6.1f "
+                                       fstr = " %6.1f %6.1f %6.1f %6.1f %6.1f "
                                                "%4.1f %4.1f %6.1f %6.1f "
                                                "%3.0f %3.0f ";
                                } else {
-                                       fstr = "%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,"
+                                       fstr = 
"%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,"
                                                "%.1f,%.1f,%.0f,%.0f";
                                }
-                               push_out(fstr, rps, wps, krps, kwps, avw, avr,
+                               push_out(fstr, rps+wps, rps, wps, krps, kwps, 
avw, avr,
                                    wserv, rserv, w_pct, r_pct);
                        }
                }
@@ -1279,7 +1279,7 @@
                                        /* without -r option */
                                        (void) snprintf(disk_header,
                                            sizeof (disk_header),
-                                           "%-*.*s    r/%c    w/%c   "
+                                           "%-*.*s    i/o    r/%c    w/%c   "
                                            "%cr/%c   %cw/%c wait actv  "
                                            "svc_t  %%%%w  %%%%b %s",
                                            iodevs_nl, iodevs_nl, "device",
@@ -1288,7 +1288,7 @@
                                        /* with -r option */
                                        (void) snprintf(disk_header,
                                            sizeof (disk_header),
-                                           "device,r/%c,w/%c,%cr/%c,%cw/%c,"
+                                           
"device,i/o,r/%c,w/%c,%cr/%c,%cw/%c,"
                                            "wait,actv,svc_t,%%%%w,"
                                            "%%%%b,%s",
                                            ch, ch, iosz, ch, iosz, ch, header);
@@ -1296,11 +1296,11 @@
                        } else {
                                /* with -n option */
                                if (do_raw == 0) {
-                                       fstr = "    r/%c    w/%c   %cr/%c   "
+                                       fstr = "    i/o    r/%c    w/%c   
%cr/%c   "
                                            "%cw/%c wait actv wsvc_t asvc_t  "
                                            "%%%%w  %%%%b %sdevice";
                                } else {
-                                       fstr = "r/%c,w/%c,%cr/%c,%cw/%c,"
+                                       fstr = "i/o,r/%c,w/%c,%cr/%c,%cw/%c,"
                                            "wait,actv,wsvc_t,asvc_t,"
                                            "%%%%w,%%%%b,%sdevice";
                                }
--------------------------------------------------------------------------------------------------------------------

difference in output:

bash-3.00# iostat -x 
                 extended device statistics                 
device    r/s    w/s   kr/s   kw/s wait actv  svc_t  %w  %b 
cmdk0     0.8    0.4   12.3    1.4  0.0  0.0   10.0   0   0 
fd0       0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0 
sd0       0.0    0.0    0.0    0.0  0.0  0.0    0.9   0   0 

bash-3.00# ./iostat -x
                    extended device statistics                     
device    i/o    r/s    w/s   kr/s   kw/s wait actv  svc_t  %w  %b 
cmdk0     1.2    0.8    0.4   12.3    1.4  0.0  0.0   10.0   0   0 
fd0       0.0    0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0 
sd0       0.0    0.0    0.0    0.0    0.0  0.0  0.0    0.9   0   0



Reply via email to