summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-02-08 02:11:52 +0000
committerdillon <dillon@FreeBSD.org>1999-02-08 02:11:52 +0000
commita7037f5e36e22ca942c25519a64b889fe20f27f8 (patch)
tree3eb8200509fcc0dc8132779913f598781f778aa0 /usr.bin/systat
parent63e9231cca98e15e3cf98a075073ea0787f9d057 (diff)
downloadFreeBSD-src-a7037f5e36e22ca942c25519a64b889fe20f27f8.zip
FreeBSD-src-a7037f5e36e22ca942c25519a64b889fe20f27f8.tar.gz
If there are 4 or fewer disk devices, we have room to display additional
VM statistics. zfod is moved and %slo-z ( percentage of zero-fills that were slow, i.e. not pre-zero'd ), and number of pages freed per second.
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/systat.11
-rw-r--r--usr.bin/systat/vmstat.c43
2 files changed, 39 insertions, 5 deletions
diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1
index 64dfa35..1c7e3d4 100644
--- a/usr.bin/systat/systat.1
+++ b/usr.bin/systat/systat.1
@@ -333,6 +333,7 @@ Below the paging statistics is a column of lines regarding the virtual
memory system which list the average number of
pages copied on write (`cow'),
pages zero filled on demand (`zfod'),
+slow (on-the-fly) zero fills percentage (`%slo-z'),
pages wired down (`wire'),
active pages (`act'),
inactive pages (`inact'),
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index bfd8e81..787e68e 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.32 1999/01/09 06:03:54 obrien Exp $";
#endif /* not lint */
/*
@@ -113,6 +113,7 @@ static int nintr;
static long *intrloc;
static char **intrname;
static int nextintsrow;
+static int extended_vm_stats;
struct utmp utmp;
@@ -296,8 +297,7 @@ labelkre()
mvprintw(INTSROW, INTSCOL + 3, " Interrupts");
mvprintw(INTSROW + 1, INTSCOL + 9, "total");
- mvprintw(VMSTATROW + 0, VMSTATCOL + 10, "cow");
- mvprintw(VMSTATROW + 1, VMSTATCOL + 10, "zfod");
+ mvprintw(VMSTATROW + 1, VMSTATCOL + 10, "cow");
mvprintw(VMSTATROW + 2, VMSTATCOL + 10, "wire");
mvprintw(VMSTATROW + 3, VMSTATCOL + 10, "act");
mvprintw(VMSTATROW + 4, VMSTATCOL + 10, "inact");
@@ -346,6 +346,20 @@ labelkre()
" %5.5s", tmpstr);
j++;
}
+
+ if (j <= 4) {
+ /*
+ * room for extended VM stats
+ */
+ mvprintw(VMSTATROW + 11, VMSTATCOL - 6, "zfod");
+ mvprintw(VMSTATROW + 12, VMSTATCOL - 6, "%%slo-z");
+ mvprintw(VMSTATROW + 13, VMSTATCOL - 6, "tfree");
+ extended_vm_stats = 1;
+ } else {
+ extended_vm_stats = 0;
+ mvprintw(VMSTATROW + 0, VMSTATCOL + 10, "zfod");
+ }
+
for (i = 0; i < nintr; i++) {
if (intrloc[i] == 0)
continue;
@@ -457,8 +471,10 @@ showkre()
putint(total.t_dw, PROCSROW + 1, PROCSCOL + 9, 3);
putint(total.t_sl, PROCSROW + 1, PROCSCOL + 12, 3);
putint(total.t_sw, PROCSROW + 1, PROCSCOL + 15, 3);
- PUTRATE(Cnt.v_cow_faults, VMSTATROW + 0, VMSTATCOL + 3, 6);
- PUTRATE(Cnt.v_zfod, VMSTATROW + 1, VMSTATCOL + 4, 5);
+ if (extended_vm_stats == 0) {
+ PUTRATE(Cnt.v_zfod, VMSTATROW + 0, VMSTATCOL + 4, 5);
+ }
+ PUTRATE(Cnt.v_cow_faults, VMSTATROW + 1, VMSTATCOL + 3, 6);
putint(pgtokb(cnt.v_wire_count), VMSTATROW + 2, VMSTATCOL, 9);
putint(pgtokb(cnt.v_active_count), VMSTATROW + 3, VMSTATCOL, 9);
putint(pgtokb(cnt.v_inactive_count), VMSTATROW + 4, VMSTATCOL, 9);
@@ -470,6 +486,23 @@ showkre()
PUTRATE(Cnt.v_pdwakeups, VMSTATROW + 10, VMSTATCOL, 9);
PUTRATE(Cnt.v_pdpages, VMSTATROW + 11, VMSTATCOL, 9);
PUTRATE(Cnt.v_intrans, VMSTATROW + 12, VMSTATCOL, 9);
+
+ if (extended_vm_stats) {
+ Y(Cnt.v_ozfod);
+
+ PUTRATE(Cnt.v_zfod, VMSTATROW + 11, VMSTATCOL - 16, 9);
+ putint(
+ ((s.Cnt.v_ozfod < s.Cnt.v_zfod) ?
+ s.Cnt.v_ozfod * 100 / s.Cnt.v_zfod :
+ 0
+ ),
+ VMSTATROW + 12,
+ VMSTATCOL - 16,
+ 9
+ );
+ PUTRATE(Cnt.v_tfree, VMSTATROW + 13, VMSTATCOL - 16, 9);
+ }
+
putint(s.bufspace/1024, VMSTATROW + 13, VMSTATCOL, 9);
putint(s.desiredvnodes, VMSTATROW + 14, VMSTATCOL, 9);
putint(s.numvnodes, VMSTATROW + 15, VMSTATCOL, 9);
OpenPOWER on IntegriCloud