summaryrefslogtreecommitdiffstats
path: root/openbsd
diff options
context:
space:
mode:
authorIan Sutton <ians@openbsd.org>2018-07-17 08:43:50 -0500
committerIan Sutton <ians@openbsd.org>2018-07-17 08:43:50 -0500
commit48b807b0ff892d41387f6cedfb3668e2bcc246ac (patch)
treec259763e069e1b6fa4ca3dfa899563eb511a1f4d /openbsd
parent666e1e76b39ee66a38f5fb620d22b23f36859eca (diff)
Fix CPU meters
Introduction of CP_SPIN sched state broke hard-coded state indexes resulting in the meters incorrectly reporting bogus intr data instead of CPU usage. Change hardcoded values to sched.h macros.
Diffstat (limited to 'openbsd')
-rw-r--r--openbsd/Platform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsd/Platform.c b/openbsd/Platform.c
index 01b6c478..cda424b6 100644
--- a/openbsd/Platform.c
+++ b/openbsd/Platform.c
@@ -46,7 +46,7 @@ extern ProcessFieldData Process_fields[];
#define MAXCPU 256
// XXX: probably should be a struct member
-static int64_t old_v[MAXCPU][5];
+static int64_t old_v[MAXCPU][CPUSTATES];
/*
* Copyright (c) 1984, 1989, William LeFebvre, Rice University
@@ -225,7 +225,7 @@ double Platform_setCPUValues(Meter* this, int cpu) {
v[i] = diff_v[i] / 10.;
}
- Meter_setItems(this, 4);
+ Meter_setItems(this, CP_IDLE);
perc = v[0] + v[1] + v[2] + v[3];

© 2014-2024 Faster IT GmbH | imprint | privacy policy