summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2019-08-10 17:17:45 -0700
committerArnavion <arnavion@gmail.com>2019-08-10 17:17:45 -0700
commit909bb86f05c20f0ec6f5d55994065a293932ce21 (patch)
treea74598e116cbbdb0c5da973734affe596bd9d777
parent43728b37e76e4ed32b04c133ca55e27116cdfa06 (diff)
Show N/A on unsupported platforms instead of 0KHz
-rw-r--r--darwin/Platform.c2
-rw-r--r--dragonflybsd/Platform.c3
-rw-r--r--freebsd/Platform.c3
-rw-r--r--openbsd/Platform.c2
-rw-r--r--solaris/Platform.c3
-rw-r--r--unsupported/Platform.c5
6 files changed, 17 insertions, 1 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c
index 1dce8b67..cd45bedf 100644
--- a/darwin/Platform.c
+++ b/darwin/Platform.c
@@ -217,6 +217,8 @@ double Platform_setCPUValues(Meter* mtr, int cpu) {
/* Convert to percent and return */
total = mtr->values[CPU_METER_NICE] + mtr->values[CPU_METER_NORMAL] + mtr->values[CPU_METER_KERNEL];
+ mtr->values[CPU_METER_FREQUENCY] = -1;
+
return CLAMP(total, 0.0, 100.0);
}
diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c
index 370943d7..250e50e7 100644
--- a/dragonflybsd/Platform.c
+++ b/dragonflybsd/Platform.c
@@ -179,6 +179,9 @@ double Platform_setCPUValues(Meter* this, int cpu) {
percent = CLAMP(percent, 0.0, 100.0);
if (isnan(percent)) percent = 0.0;
+
+ v[CPU_METER_FREQUENCY] = -1;
+
return percent;
}
diff --git a/freebsd/Platform.c b/freebsd/Platform.c
index 5dd6ca41..16d02329 100644
--- a/freebsd/Platform.c
+++ b/freebsd/Platform.c
@@ -178,6 +178,9 @@ double Platform_setCPUValues(Meter* this, int cpu) {
percent = CLAMP(percent, 0.0, 100.0);
if (isnan(percent)) percent = 0.0;
+
+ v[CPU_METER_FREQUENCY] = -1;
+
return percent;
}
diff --git a/openbsd/Platform.c b/openbsd/Platform.c
index 4bb2e35e..e5a67d9f 100644
--- a/openbsd/Platform.c
+++ b/openbsd/Platform.c
@@ -233,6 +233,8 @@ double Platform_setCPUValues(Meter* this, int cpu) {
perc = v[0] + v[1] + v[2] + v[3];
+ v[CPU_METER_FREQUENCY] = -1;
+
if (perc <= 100. && perc >= 0.) {
return perc;
} else {
diff --git a/solaris/Platform.c b/solaris/Platform.c
index a29fcb47..c180d988 100644
--- a/solaris/Platform.c
+++ b/solaris/Platform.c
@@ -203,6 +203,9 @@ double Platform_setCPUValues(Meter* this, int cpu) {
percent = CLAMP(percent, 0.0, 100.0);
if (isnan(percent)) percent = 0.0;
+
+ v[CPU_METER_FREQUENCY] = -1;
+
return percent;
}
diff --git a/unsupported/Platform.c b/unsupported/Platform.c
index ba844191..b5e50c3f 100644
--- a/unsupported/Platform.c
+++ b/unsupported/Platform.c
@@ -108,8 +108,11 @@ int Platform_getMaxPid() {
}
double Platform_setCPUValues(Meter* this, int cpu) {
- (void) this;
(void) cpu;
+
+ double* v = this->values;
+ v[CPU_METER_FREQUENCY] = -1;
+
return 0.0;
}

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