summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcanacar <canacar@openbsd.org>2008-11-01 00:56:25 +0000
committercanacar <canacar@openbsd.org>2008-11-01 00:56:25 +0000
commit798e78336ba08d46d1e017a47adfcd89f08d80a1 (patch)
treec5609345cc9284c31a8ab33751ca46b43dd041c3
parentRemove disabled help text code and -S command, both leftovers from pftop, (diff)
downloadwireguard-openbsd-798e78336ba08d46d1e017a47adfcd89f08d80a1.tar.xz
wireguard-openbsd-798e78336ba08d46d1e017a47adfcd89f08d80a1.zip
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
}