summaryrefslogtreecommitdiffstats
path: root/usr.bin/vmstat
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>1999-02-10 00:04:13 +0000
committerken <ken@FreeBSD.org>1999-02-10 00:04:13 +0000
commit542b263658139322bf3d5bd62bad9800e74aad45 (patch)
treeb4c5c45958dd1ae9b164c02cc708e4fa28bf4bd4 /usr.bin/vmstat
parent4eda991f81cae280580852f81db79122e1013f3c (diff)
downloadFreeBSD-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 'usr.bin/vmstat')
-rw-r--r--usr.bin/vmstat/vmstat.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 3bc3a7c..067d6d7 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)vmstat.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: vmstat.c,v 1.27 1998/09/20 00:11:17 ken Exp $";
+ "$Id: vmstat.c,v 1.29 1998/10/28 06:41:24 jdp Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -278,6 +278,15 @@ main(argc, argv)
char **getdrivedata();
struct winsize winsize;
+ /*
+ * Make sure that the userland devstat version matches the
+ * kernel devstat version. If not, exit and print a
+ * message informing the user of his mistake.
+ */
+ if (checkversion() < 0)
+ errx(1, "%s", devstat_errbuf);
+
+
argv = getdrivedata(argv);
winsize.ws_row = 0;
(void) ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&winsize);
@@ -426,14 +435,6 @@ dovmstat(interval, reps)
if (!hz)
kread(X_HZ, &hz, sizeof(hz));
- /*
- * Make sure that the userland devstat version matches the kernel
- * devstat version. If not, exit and print a message informing
- * the user of his mistake.
- */
- if (checkversion() < 0)
- errx(1, "%s", devstat_errbuf);
-
for (hdrcnt = 1;;) {
if (!--hdrcnt)
printhdr();
OpenPOWER on IntegriCloud