diff options
author | obrien <obrien@FreeBSD.org> | 1998-12-27 17:59:42 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1998-12-27 17:59:42 +0000 |
commit | ab302cd2cde3a14092cba2812798a98860e1e41b (patch) | |
tree | 389feda545825cc4c46da1cb339aa7d342b85fd4 /usr.bin | |
parent | edceb2d6b39e794b1b80d1f8de7cc63d52408a8a (diff) | |
download | FreeBSD-src-ab302cd2cde3a14092cba2812798a98860e1e41b.zip FreeBSD-src-ab302cd2cde3a14092cba2812798a98860e1e41b.tar.gz |
Turn the compile time option into a run-time option.
You can now use the `want_fd' command in the vmstat display.
Suggested by: grog
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/systat/systat.1 | 2 | ||||
-rw-r--r-- | usr.bin/systat/vmstat.c | 15 |
2 files changed, 10 insertions, 7 deletions
diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1 index b035eb9..bbf2201 100644 --- a/usr.bin/systat/systat.1 +++ b/usr.bin/systat/systat.1 @@ -374,6 +374,8 @@ Display statistics as a running total from the point this command is given. .It Cm time Display statistics averaged over the refresh interval (the default). +.It Cm want_fd +Toggle the display of fd devices in the disk usage display. .It Cm zero Reset running statistics to zero. .El diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 86fdbf6..bf90fda 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94"; #endif static const char rcsid[] = - "$Id: vmstat.c,v 1.29 1998/10/08 09:56:10 obrien Exp $"; + "$Id: vmstat.c,v 1.30 1998/12/27 08:15:37 obrien Exp $"; #endif /* not lint */ /* @@ -93,6 +93,7 @@ struct statinfo cur, last, run; #define oldnchtotal s1.nchstats static enum state { BOOT, TIME, RUN } state = TIME; +static int want_fd = 0; static void allocinfo __P((struct Info *)); static void copyinfo __P((struct Info *, struct Info *)); @@ -340,10 +341,8 @@ labelkre() for (i = 0; i < num_devices && j < MAXDRIVES; i++) if (dev_select[i].selected) { char tmpstr[80]; -#ifndef WANT_FD - if (0==strcmp("fd", dev_select[i].device_name)) + if (!want_fd && 0==strcmp("fd", dev_select[i].device_name)) continue; -#endif sprintf(tmpstr, "%s%d", dev_select[i].device_name, dev_select[i].unit_number); mvprintw(DISKROW, DISKCOL + 5 + 6 * j, @@ -496,10 +495,8 @@ showkre() for (i = 0, c = 0; i < num_devices && c < MAXDRIVES; i++) if (dev_select[i].selected) { char tmpstr[80]; -#ifndef WANT_FD - if (0==strcmp("fd", dev_select[i].device_name)) + if (!want_fd && 0==strcmp("fd", dev_select[i].device_name)) continue; -#endif sprintf(tmpstr, "%s%d", dev_select[i].device_name, dev_select[i].unit_number); mvprintw(DISKROW, DISKCOL + 5 + 6 * c, @@ -564,6 +561,10 @@ cmdkre(cmd, args) state = TIME; return (1); } + if (prefix(cmd, "want_fd")) { + want_fd = !want_fd; + return (1); + } if (prefix(cmd, "zero")) { retval = 1; if (state == RUN) { |