diff options
author | ken <ken@FreeBSD.org> | 1999-02-10 00:04:13 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 1999-02-10 00:04:13 +0000 |
commit | 542b263658139322bf3d5bd62bad9800e74aad45 (patch) | |
tree | b4c5c45958dd1ae9b164c02cc708e4fa28bf4bd4 /sys/i386 | |
parent | 4eda991f81cae280580852f81db79122e1013f3c (diff) | |
download | FreeBSD-src-542b263658139322bf3d5bd62bad9800e74aad45.zip FreeBSD-src-542b263658139322bf3d5bd62bad9800e74aad45.tar.gz |
Add a prioritization field to the devstat_add_entry() call so that
peripheral drivers can determine where in the devstat(9) list they are
inserted.
This requires recompilation of libdevstat, systat, vmstat, rpc.rstatd, and
any ports that depend on the devstat code, since the size of the devstat
structure has changed. The devstat version number has been incremented as
well to reflect the change.
This sorts devices in the devstat list in "more interesting" to "less
interesting" order. So, for instance, da devices are now more important
than floppy drives, and so will appear before floppy drives in the default
output from systat, iostat, vmstat, etc.
The order of devices is, for now, kept in a central table in devicestat.h.
If individual drivers were able to make a meaningful decision on what
priority they should be at attach time, we could consider splitting the
priority information out into the various drivers. For now, though, they
have no way of knowing that, so it's easier to put them in an easy to find
table.
Also, move the checkversion() call in vmstat(8) to a more logical place.
Thanks to Bruce and David O'Brien for suggestions, for reviewing this, and
for putting up with the long time it has taken me to commit it. Bruce did
object somewhat to the central priority table (he would rather the
priorities be distributed in each driver), so his objection is duly noted
here.
Reviewed by: bde, obrien
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/isa/atapi-cd.c | 8 | ||||
-rw-r--r-- | sys/i386/isa/fd.c | 5 | ||||
-rw-r--r-- | sys/i386/isa/wd.c | 6 | ||||
-rw-r--r-- | sys/i386/isa/wd_cd.c | 8 | ||||
-rw-r--r-- | sys/i386/isa/wfd.c | 5 |
5 files changed, 20 insertions, 12 deletions
diff --git a/sys/i386/isa/atapi-cd.c b/sys/i386/isa/atapi-cd.c index be09c36..b716e69 100644 --- a/sys/i386/isa/atapi-cd.c +++ b/sys/i386/isa/atapi-cd.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: atapi-cd.c,v 1.9 1999/01/31 21:51:03 sos Exp $ + * $Id: atapi-cd.c,v 1.10 1999/01/31 23:08:47 sos Exp $ */ #include "wdc.h" @@ -265,13 +265,15 @@ acdattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug) sprintf(string, "acd%d-", cdp->lun); devstat_add_entry(cdp->device_stats, string, tmpcdp->lun, DEV_BSIZE, DEVSTAT_NO_ORDERED_TAGS, - DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE); + DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE, + DEVSTAT_PRIORITY_WCD); } else { acdnlun++; devstat_add_entry(cdp->device_stats, "acd", cdp->lun, DEV_BSIZE, DEVSTAT_NO_ORDERED_TAGS, - DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE); + DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE, + DEVSTAT_PRIORITY_WCD); } return 1; } diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c index 9972a38..d0dd782 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/isa/fd.c @@ -47,7 +47,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.131 1999/01/15 09:15:27 bde Exp $ + * $Id: fd.c,v 1.132 1999/01/19 00:21:36 peter Exp $ * */ @@ -869,7 +869,8 @@ fdattach(struct isa_device *dev) devstat_add_entry(&fd->device_stats, "fd", fdu, 512, DEVSTAT_NO_ORDERED_TAGS, - DEVSTAT_TYPE_FLOPPY | DEVSTAT_TYPE_IF_OTHER); + DEVSTAT_TYPE_FLOPPY | DEVSTAT_TYPE_IF_OTHER, + DEVSTAT_PRIORITY_FD); } diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c index 44a2861..fcfb002 100644 --- a/sys/i386/isa/wd.c +++ b/sys/i386/isa/wd.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.186 1999/01/17 05:46:24 bde Exp $ + * $Id: wd.c,v 1.187 1999/01/27 19:32:34 julian Exp $ */ /* TODO: @@ -549,7 +549,9 @@ wdattach(struct isa_device *dvp) devstat_add_entry(&du->dk_stats, "wd", lunit, du->dk_dd.d_secsize, DEVSTAT_NO_ORDERED_TAGS, - DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_IDE); + DEVSTAT_TYPE_DIRECT | + DEVSTAT_TYPE_IF_IDE, + DEVSTAT_PRIORITY_WD); } else { free(du, M_TEMP); diff --git a/sys/i386/isa/wd_cd.c b/sys/i386/isa/wd_cd.c index be09c36..b716e69 100644 --- a/sys/i386/isa/wd_cd.c +++ b/sys/i386/isa/wd_cd.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: atapi-cd.c,v 1.9 1999/01/31 21:51:03 sos Exp $ + * $Id: atapi-cd.c,v 1.10 1999/01/31 23:08:47 sos Exp $ */ #include "wdc.h" @@ -265,13 +265,15 @@ acdattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug) sprintf(string, "acd%d-", cdp->lun); devstat_add_entry(cdp->device_stats, string, tmpcdp->lun, DEV_BSIZE, DEVSTAT_NO_ORDERED_TAGS, - DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE); + DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE, + DEVSTAT_PRIORITY_WCD); } else { acdnlun++; devstat_add_entry(cdp->device_stats, "acd", cdp->lun, DEV_BSIZE, DEVSTAT_NO_ORDERED_TAGS, - DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE); + DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE, + DEVSTAT_PRIORITY_WCD); } return 1; } diff --git a/sys/i386/isa/wfd.c b/sys/i386/isa/wfd.c index b47b1e5..17b434c 100644 --- a/sys/i386/isa/wfd.c +++ b/sys/i386/isa/wfd.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: wfd.c,v 1.17 1998/12/07 21:58:24 archie Exp $ + * $Id: wfd.c,v 1.18 1999/01/30 12:21:44 phk Exp $ */ /* @@ -273,7 +273,8 @@ wfdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug) devstat_add_entry(&t->device_stats, "wfd", wfdnlun, t->cap.sector_size, DEVSTAT_NO_ORDERED_TAGS, - DEVSTAT_TYPE_FLOPPY | DEVSTAT_TYPE_IF_IDE); + DEVSTAT_TYPE_FLOPPY | DEVSTAT_TYPE_IF_IDE, + DEVSTAT_PRIORITY_WFD); return (1); } |