Subject: separate read vs. write disk stats.
To: None <tech-kern@netbsd.org>
From: matthew green <mrg@eterna.com.au>
List: tech-kern
Date: 10/28/2002 19:37:22
hi folks.


i've implemented separate read/write statistics for disks.  the kernel
portion is just changing disk_unbusy() to take a direction parameter,
adjusting struct disk to have the new parts and updating the sysctl
to deal with this(1).

the changes to userland however are entirely different.  my question
is: how should this info be displayed?  we have 3 programs to update
(vmstat, iostat and systat) and each has it's own methods of displaying
the data (often more than one method, infact.)

one could change the current default output to include both read/write
stats but i think that might break someone's script and it also uses
more of the already precious screen (line) real estate, so i don't like
that option a whole lot.

one option would be to add the stats to iostat's -x ('extended') output,
add a -x flag to vmstat to enable it, and some other option to systat.
(for systat, i currently have code that does this with ":all" and ":rw"
commands to switch between them, default of "all".  alternate suggestions
on these names welcome.)  i believe that solaris shows read & write
separately with 'iostat -x'.  linux iostat seems weird, but it also
shows separate stats with -x.  this is what i would like to do (though
i have mostly implemented parts of the former and the latter currently ;)

another would be to invent a new switch (i propose -X) that enables
this for both iostat & vmstat, and probably still the same for systat
as above.


comments?  i'd like to get this in the tree ASAP.  (i have tested most
of the changed files and will be cross compile testing all of them,
i have only sparc64, amiga, arc & atari left to build "GENERIC" for.)


.mrg.


(1) unfortunately, while the change *should* be backwards compatible,
due to broken code in vmstat/dkstats.c, old tools will get strange
data.  however, future changes should not be broken.