summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2010-11-19 18:35:17 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2010-11-19 18:35:17 +0000
commit0ae08084bdeee734850317c2723d814a0ac8bad1 (patch)
treee0033192617f7d77a5ca4c81a628b41162f9587a /sys/kern/kern_sysctl.c
parent7d02c14675c111c2f4359f11c604d837f3538ab4 (diff)
Make KERN_CPTIME return an avarage number of ticks across all CPUs
tedu agreed with an idea, tested by Luis Useche and me; ok deraadt
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 7ebac0128e6..0ebcf20cbeb 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.194 2010/11/02 09:36:09 dlg Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.195 2010/11/19 18:35:16 mikeb Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -469,6 +469,9 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
cp_time[i] += ci->ci_schedstate.spc_cp_time[i];
}
+ for (i = 0; i < CPUSTATES; i++)
+ cp_time[i] /= ncpus;
+
return (sysctl_rdstruct(oldp, oldlenp, newp, &cp_time,
sizeof(cp_time)));
}