From 9991ea71785cc4e8661e8fee0aa7475726c7ad87 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 22 Dec 2002 05:04:30 +0000 Subject: [PATCH] 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 Note: also slated for 5.0 --- sys/vm/vm_meter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 178f5a908ae..af1d55ddd25 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);