summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-02-15 09:34:08 +0000
committerphk <phk@FreeBSD.org>2004-02-15 09:34:08 +0000
commit2d2cf7594fadd3341a5ecaa793e9746fa3891150 (patch)
tree2820f64362754da11ddff2258147285fae13b854 /usr.sbin
parent0aa2a0d969384d0ad743b2680e11eeca8c712896 (diff)
downloadFreeBSD-src-2d2cf7594fadd3341a5ecaa793e9746fa3891150.zip
FreeBSD-src-2d2cf7594fadd3341a5ecaa793e9746fa3891150.tar.gz
Add -d flag to monitor BIO_DELETE operations too
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/gstat/gstat.83
-rw-r--r--usr.sbin/gstat/gstat.c28
2 files changed, 27 insertions, 4 deletions
diff --git a/usr.sbin/gstat/gstat.8 b/usr.sbin/gstat/gstat.8
index 7804640..412c13a 100644
--- a/usr.sbin/gstat/gstat.8
+++ b/usr.sbin/gstat/gstat.8
@@ -33,6 +33,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl c
+.Op Fl d
.Op Fl I Ar interval
.Sh DESCRIPTION
The
@@ -50,6 +51,8 @@ consumers too.
The default is to show statistics only for
.Xr geom 4
producers.
+.It Fl d
+Enable display of statistics for delete (BIO_DELETE) operations.
.It Fl I Ar interval
Refresh the
.Nm
diff --git a/usr.sbin/gstat/gstat.c b/usr.sbin/gstat/gstat.c
index 885b9c4..b4565fb 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;
+static int flag_c, flag_d;
static int flag_I = 500000;
static void usage(void);
@@ -66,14 +66,17 @@ main(int argc, char **argv)
struct gident *gid;
short cf, cb;
char *p;
- long double ld[8];
+ long double ld[11];
uint64_t u64;
- while ((i = getopt(argc, argv, "cI:")) != -1) {
+ while ((i = getopt(argc, argv, "dcI:")) != -1) {
switch (i) {
case 'c':
flag_c = 1;
break;
+ case 'd':
+ flag_d = 1;
+ break;
case 'I':
p = NULL;
i = strtoul(optarg, &p, 0);
@@ -136,7 +139,12 @@ main(int argc, char **argv)
move(0,0);
printw("dT: %5.3f flag_I %dus sizeof %d i %d\n",
dt, flag_I, sizeof(*gsp), i);
- printw(" L(q) ops/s r/s kBps ms/r w/s kBps ms/w %%busy Name\n");
+ printw(" L(q) ops/s ");
+ printw(" r/s kBps ms/r ");
+ printw(" w/s kBps ms/d ");
+ if (flag_d)
+ printw(" d/s kBps ms/d ");
+ printw("%%busy Name\n");
for (;;) {
gsp = geom_stats_snapshot_next(sp);
gsq = geom_stats_snapshot_next(sq);
@@ -163,13 +171,19 @@ main(int argc, char **argv)
devstat_compute_statistics(gsp, gsq, dt,
DSM_QUEUE_LENGTH, &u64,
DSM_TRANSFERS_PER_SECOND, &ld[0],
+
DSM_TRANSFERS_PER_SECOND_READ, &ld[1],
DSM_MB_PER_SECOND_READ, &ld[2],
DSM_MS_PER_TRANSACTION_READ, &ld[3],
+
DSM_TRANSFERS_PER_SECOND_WRITE, &ld[4],
DSM_MB_PER_SECOND_WRITE, &ld[5],
DSM_MS_PER_TRANSACTION_WRITE, &ld[6],
+
DSM_BUSY_PCT, &ld[7],
+ DSM_TRANSFERS_PER_SECOND_FREE, &ld[8],
+ DSM_MB_PER_SECOND_FREE, &ld[9],
+ DSM_MS_PER_TRANSACTION_FREE, &ld[10],
DSM_NONE);
printw(" %4ju", (uintmax_t)u64);
@@ -181,6 +195,12 @@ main(int argc, char **argv)
printw(" %6.0f", (double)ld[5] * 1024);
printw(" %6.1f", (double)ld[6]);
+ if (flag_d) {
+ printw(" %6.0f", (double)ld[8]);
+ printw(" %6.0f", (double)ld[9] * 1024);
+ printw(" %6.1f", (double)ld[10]);
+ }
+
if (ld[7] > 80)
i = 3;
else if (ld[7] > 50)
OpenPOWER on IntegriCloud