diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2014-07-14 13:31:18 -0700 |
|---|---|---|
| committer | Robert Mustacchi <rm@joyent.com> | 2014-07-16 10:24:12 -0700 |
| commit | 542a813c9f6736dc348fecc7244bf22b4e0a319c (patch) | |
| tree | e5d76ed0ea267bf2388b93f49c2e9e473cf0b2be /usr/src/uts/common/sys/zone.h | |
| parent | 732efd5515b5788339f3da4db04de7cea0f79c86 (diff) | |
| download | illumos-joyent-542a813c9f6736dc348fecc7244bf22b4e0a319c.tar.gz | |
5003 want kstats for per-zone cpu usage
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Richard Elling <richard.elling@gmail.com>
Approved by: Rich Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/uts/common/sys/zone.h')
| -rw-r--r-- | usr/src/uts/common/sys/zone.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/usr/src/uts/common/sys/zone.h b/usr/src/uts/common/sys/zone.h index 4419144f2b..18c2a9ef4b 100644 --- a/usr/src/uts/common/sys/zone.h +++ b/usr/src/uts/common/sys/zone.h @@ -378,6 +378,13 @@ typedef struct zone_kstat { struct cpucap; +typedef struct { + kstat_named_t zm_zonename; /* full name, kstat truncates name */ + kstat_named_t zm_utime; + kstat_named_t zm_stime; + kstat_named_t zm_wtime; +} zone_misc_kstat_t; + typedef struct zone { /* * zone_name is never modified once set. @@ -540,6 +547,25 @@ typedef struct zone { kstat_t *zone_nprocs_kstat; /* + * Misc. kstats and counters for zone cpu-usage aggregation. + * The zone_Xtime values are the sum of the micro-state accounting + * values for all threads that are running or have run in the zone. + * This is tracked in msacct.c as threads change state. + * The zone_stime is the sum of the LMS_SYSTEM times. + * The zone_utime is the sum of the LMS_USER times. + * The zone_wtime is the sum of the LMS_WAIT_CPU times. + * As with per-thread micro-state accounting values, these values are + * not scaled to nanosecs. The scaling is done by the + * zone_misc_kstat_update function when kstats are requested. + */ + kmutex_t zone_misc_lock; /* protects misc statistics */ + kstat_t *zone_misc_ksp; + zone_misc_kstat_t *zone_misc_stats; + uint64_t zone_stime; /* total system time */ + uint64_t zone_utime; /* total user time */ + uint64_t zone_wtime; /* total time waiting in runq */ + + /* * DTrace-private per-zone state */ int zone_dtrace_getf; /* # of unprivileged getf()s */ |
