summaryrefslogtreecommitdiffstats
path: root/sys/sys/pcpu.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2007-11-29 06:34:30 +0000
committerpeter <peter@FreeBSD.org>2007-11-29 06:34:30 +0000
commit8e9baed5537acc943e5fd7641e69438a2466c1ad (patch)
treeebdab9e1e3b077956286c642401a485f2a47e88b /sys/sys/pcpu.h
parent723157380283ac617fbbbb23fb4ae6120293007b (diff)
downloadFreeBSD-src-8e9baed5537acc943e5fd7641e69438a2466c1ad.zip
FreeBSD-src-8e9baed5537acc943e5fd7641e69438a2466c1ad.tar.gz
Move the shared cp_time array (counts %sys, %user, %idle etc) to the
per-cpu area. cp_time[] goes away and a new function creates a merged cp_time-like array for things like linprocfs, sysctl etc. The atomic ops for updating cp_time[] in statclock go away, and the scope of the thread lock is reduced. sysctl kern.cp_time returns a backwards compatible cp_time[] array. A new kern.cp_times sysctl returns the individual per-cpu stats. I have pending changes to make top and vmstat optionally show per-cpu stats. I'm very aware that there are something like 5 or 6 other versions "out there" for doing this - but none were handy when I needed them. I did merge my changes with John Baldwin's, and ended up replacing a few chunks of my stuff with his, and stealing some other code. Reviewed by: jhb Partly obtained from: jhb
Diffstat (limited to 'sys/sys/pcpu.h')
-rw-r--r--sys/sys/pcpu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index 8757fe6..168bf72 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -43,6 +43,7 @@
#include <sys/queue.h>
#include <sys/vmmeter.h>
+#include <sys/resource.h>
#include <machine/pcpu.h>
struct pcb;
@@ -82,6 +83,7 @@ struct pcpu {
#endif
PCPU_MD_FIELDS;
struct vmmeter pc_cnt; /* VM stats counters */
+ long pc_cp_time[CPUSTATES];
struct device *pc_device;
/*
OpenPOWER on IntegriCloud