mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dana Lacoste <dana.lacoste@peregrine.com>
To: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: proc/stat question
Date: Wed, 13 Mar 2002 08:34:05 -0800	[thread overview]
Message-ID: <B51F07F0080AD511AC4A0002A52CAB445B2CE8@ottonexc1.ottawa.loran.com> (raw)

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]
                          );
    }
}

             reply	other threads:[~2002-03-13 16:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-13 16:34 Dana Lacoste [this message]
2002-03-13 17:12 ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B51F07F0080AD511AC4A0002A52CAB445B2CE8@ottonexc1.ottawa.loran.com \
    --to=dana.lacoste@peregrine.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®