* proc/stat question
@ 2002-03-13 16:34 Dana Lacoste
2002-03-13 17:12 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Dana Lacoste @ 2002-03-13 16:34 UTC (permalink / raw)
To: 'linux-kernel@vger.kernel.org'
I'm looking at the disk_io: field from /proc/stat and I'm seeing
some inconsistencies. On systems with two scsi disks, everything's
fine. On systems with 2 IDE disks (hda and hdc) it only shows hda's info.
on systems with the compaq smart array controller, i get nothing.
It looks like the scsi is working fine, the IDE is not working properly,
and kstat doesn't search for /dev/ida devices (actually, that might
not be a bug, the devices are kind of annoying :)
If I understand it right, it does a loop checking all majors from
0 to 16 (DK_MAX_MAJOR, defined in kernel_stat.h) and checks each
disk (0 to 16, once again) on that major. The problem is that hdc
has major 22 and ida has major 72, so the 0-16 search just misses
everything.
So my main question : is there a way we can just print out for the known
disk devices? devfs and driverfs know how to tell if a disk is connected,
so I would think the information has to be there somewhere, right?
The relevant code is shown below (from fs/proc/proc_misc.c) :
(2.4.18 shown)
len += sprintf(page + len, "\ndisk_io: ");
for (major = 0; major < DK_MAX_MAJOR; major++) {
for (disk = 0; disk < DK_MAX_DISK; disk++) {
int active = kstat.dk_drive[major][disk] +
kstat.dk_drive_rblk[major][disk] +
kstat.dk_drive_wblk[major][disk];
if (active)
len += sprintf(page + len,
"(%u,%u):(%u,%u,%u,%u,%u) ",
major, disk,
kstat.dk_drive[major][disk],
kstat.dk_drive_rio[major][disk],
kstat.dk_drive_rblk[major][disk],
kstat.dk_drive_wio[major][disk],
kstat.dk_drive_wblk[major][disk]
);
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: proc/stat question
2002-03-13 16:34 proc/stat question Dana Lacoste
@ 2002-03-13 17:12 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2002-03-13 17:12 UTC (permalink / raw)
To: Dana Lacoste; +Cc: 'linux-kernel@vger.kernel.org'
> fine. On systems with 2 IDE disks (hda and hdc) it only shows hda's info.
> on systems with the compaq smart array controller, i get nothing.
Yeah - its old stuff, and its a bit limited. Take a look at /proc/partitions
in a currentish -ac kernel. That has the sard stuff that Red Hat did finally
merged into it
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-03-13 16:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-13 16:34 proc/stat question Dana Lacoste
2002-03-13 17:12 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®