summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2002-12-22 05:04:30 +0000
committerdillon <dillon@FreeBSD.org>2002-12-22 05:04:30 +0000
commit2afef11c570b7b725c3145fc710f8dcd8d7ed4e0 (patch)
treef06ee43ecc4c08c0e3c3d79294beaecf467ec991
parent8a34ca48d9055180b3e2c43e407927a423cc1726 (diff)
downloadFreeBSD-src-2afef11c570b7b725c3145fc710f8dcd8d7ed4e0.zip
FreeBSD-src-2afef11c570b7b725c3145fc710f8dcd8d7ed4e0.tar.gz
The UP -current was not properly counting the per-cpu VM stats in the
sysctl code. This makes 'systat -vm 1's syscall count work again. Submitted by: Michal Mertl <mime@traveller.cz> Note: also slated for 5.0
-rw-r--r--sys/vm/vm_meter.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c
index 178f5a9..af1d55d 100644
--- a/sys/vm/vm_meter.c
+++ b/sys/vm/vm_meter.c
@@ -217,6 +217,9 @@ vcnt(SYSCTL_HANDLER_ARGS)
struct pcpu *pcpu = pcpu_find(i);
count += *(int *)((char *)&pcpu->pc_cnt + offset);
}
+#else
+ int offset = (char *)arg1 - (char *)&cnt;
+ count += *(int *)((char *)PCPU_PTR(cnt) + offset);
#endif
error = SYSCTL_OUT(req, &count, sizeof(int));
return(error);
OpenPOWER on IntegriCloud