diff options
author | le <le@FreeBSD.org> | 2004-10-10 16:13:11 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2004-10-10 16:13:11 +0000 |
commit | 82d0e3bd69095f53120002933827b1a52eb7bd83 (patch) | |
tree | 237985943080ff57e53cfd87f3f519059b9ce73f /usr.sbin/gstat/gstat.c | |
parent | 9763558fd4083e9fc909724c6b364c4a4c42bd6b (diff) | |
download | FreeBSD-src-82d0e3bd69095f53120002933827b1a52eb7bd83.zip FreeBSD-src-82d0e3bd69095f53120002933827b1a52eb7bd83.tar.gz |
Add an '-a' switch to only display providers that are at least
0.1% busy.
OK'ed by: phk
Diffstat (limited to 'usr.sbin/gstat/gstat.c')
-rw-r--r-- | usr.sbin/gstat/gstat.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/gstat/gstat.c b/usr.sbin/gstat/gstat.c index c92f70e..e7bb23b 100644 --- a/usr.sbin/gstat/gstat.c +++ b/usr.sbin/gstat/gstat.c @@ -47,7 +47,7 @@ #include <devstat.h> #include <sys/devicestat.h> -static int flag_c, flag_d; +static int flag_a, flag_c, flag_d; static int flag_I = 500000; static void usage(void); @@ -69,8 +69,11 @@ main(int argc, char **argv) long double ld[11]; uint64_t u64; - while ((i = getopt(argc, argv, "dcI:")) != -1) { + while ((i = getopt(argc, argv, "adcI:")) != -1) { switch (i) { + case 'a': + flag_a = 1; + break; case 'c': flag_c = 1; break; @@ -187,6 +190,11 @@ main(int argc, char **argv) DSM_MS_PER_TRANSACTION_FREE, &ld[10], DSM_NONE); + if (flag_a && ld[7] < 0.1) { + *gsq = *gsp; + continue; + } + printw(" %4ju", (uintmax_t)u64); printw(" %6.0f", (double)ld[0]); printw(" %6.0f", (double)ld[1]); |