summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2008-11-01 00:56:26 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2008-11-01 00:56:26 +0000
commit23131f9bebb1ffbc46b9ee3354f8b6e2425aebc4 (patch)
tree32b1cebf2648373932acffdd486fbfc498d301a1
parent20afe4f80fc9eb3a412722389a085db715f9f7e5 (diff)
Improve reporting of cache misses in the vmstat view. Previously
the misses field may report negative values. The hit/miss numbers does not exactly reflect the statistics collected by the kernel but this is close enough. Report & patch from Bjorn Anderss, input from beck@ and thib@
-rw-r--r--usr.bin/systat/vmstat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index 033b3613ea0..cac7dc5118c 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmstat.c,v 1.65 2008/06/13 10:06:14 deraadt Exp $ */
+/* $OpenBSD: vmstat.c,v 1.66 2008/11/01 00:56:25 canacar Exp $ */
/* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif
-static char rcsid[] = "$OpenBSD: vmstat.c,v 1.65 2008/06/13 10:06:14 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: vmstat.c,v 1.66 2008/11/01 00:56:25 canacar Exp $";
#endif /* not lint */
/*
@@ -459,9 +459,9 @@ showkre(void)
putint(nchtotal.ncs_pass2, NAMEIROW + 2, NAMEICOL + 24, 7);
putfloat(nchtotal.ncs_pass2 * 100.0 / nz(s.nchcount),
NAMEIROW + 2, NAMEICOL + 33, 4, 0, 1);
- putint(nchtotal.ncs_miss - nchtotal.ncs_pass2,
+ putint(nchtotal.ncs_miss + nchtotal.ncs_long - nchtotal.ncs_pass2,
NAMEIROW + 2, NAMEICOL + 38, 7);
- putfloat((nchtotal.ncs_miss - nchtotal.ncs_pass2) *
+ putfloat((nchtotal.ncs_miss + nchtotal.ncs_long - nchtotal.ncs_pass2) *
100.0 / nz(s.nchcount), NAMEIROW + 2, NAMEICOL + 45, 4, 0, 1);
#undef nz
}