Return to BSD News archive
Newsgroups: comp.unix.bsd Path: sserve!manuel!munnari.oz.au!mips!mips!sdd.hp.com!wupost!uunet!mcsun!sunic!ugle.unit.no!spurv.runit.sintef.no!he From: Havard.Eidnes@runit.sintef.no (Havard Eidnes) Subject: iostat -- missing kernel pieces Message-ID: <1992Jul22.221949.6680@ugle.unit.no> Originator: he@spurv.runit.sintef.no Sender: news@ugle.unit.no (NetNews Administrator) Organization: Computing Center at the University of Trondheim, Norway Date: Wed, 22 Jul 92 22:19:49 GMT Lines: 30 Hi, this evening's project of 386bsd 0.1 hacking was planned to be a port of iostat from NET2. I've modified the names.c file in usr.bin/vmstat to read in the device structs from _isa_devtab_bio, and on "my" system it finds fd0 and as0 just fine. I noted one odd thing, and that was that the isa_device struct lacks a id_dk field, which on the other systems names.c support apparently is to be used as a global index of some sort. I worked around this by using a local index, and counting it up as I went through the bdev (?) device table. The rest of iostat compiled more or less effortlessly. However: iostat does not show any values other than 0 for the "sps", "tps" or "msps" fields for all drives. These values are supposed to be fetched from various arrays in the kernel: dk_xfer, dk_wds, dk_seek etc. After grepping through the kernel sources, it appears that the only place these variables are ever mentioned is in the sys/dkstat.h include file -- noone ever bothers to update these arrays. I did in particular investigate the device drivers for wd, as and fd, and came up emptyhanded. Without a global "disk index" in the block (?) device table and without device drivers updating these statistics, it appears that it is going to be difficult to create an iostat which shows any useful info. Unfortunately, hacking in the global disk index and modifying the device drivers are currently above my skill level, and I don't have the available time (sorry -- vacation soon too...), so I'm going to shelve this project for now. If someone decides to put in the disk index and the device drivers are modified accordingly, I'll happily pick it up again. ;-) - Havard