diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-03-19 17:34:12 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-03-20 18:30:08 +0100 |
commit | e4e3f6c390452b4996ece4c92284410e58634052 (patch) | |
tree | 4eecba9bef2671700dd171d787b33f451fa938d6 /openbsd/Platform.c | |
parent | 58ad020aca933de5f1e975ccba041ff720261926 (diff) |
OpenBSD: update
* Set process data for:
- minflt
- majflt
- processor
- nlwp
* Drop unimplemented nlwp column
* Scan userland threads
* Mark a 'Thread is currently on a CPU.' with 'R', and processes
'Currently runnable' with 'P', do confine with man:ps(1) and Linux.
See https://man.openbsd.org/ps.1
* Show CPU frequency
Diffstat (limited to 'openbsd/Platform.c')
-rw-r--r-- | openbsd/Platform.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/openbsd/Platform.c b/openbsd/Platform.c index c57e6cc3..e95419b7 100644 --- a/openbsd/Platform.c +++ b/openbsd/Platform.c @@ -15,6 +15,8 @@ in the source distribution for its full text. #include <stdlib.h> #include <string.h> #include <time.h> +#include <sys/signal.h> // needs to be included before <sys/proc.h> for 'struct sigaltstack' +#include <sys/proc.h> #include <sys/resource.h> #include <sys/sensors.h> #include <sys/sysctl.h> @@ -162,8 +164,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { } int Platform_getMaxPid() { - // this is hard-coded in sys/proc.h - no sysctl exists - return 99999; + return 2 * THREAD_PID_OFFSET; } double Platform_setCPUValues(Meter* this, int cpu) { @@ -196,6 +197,8 @@ double Platform_setCPUValues(Meter* this, int cpu) { v[CPU_METER_TEMPERATURE] = NAN; + v[CPU_METER_FREQUENCY] = (pl->cpuSpeed != -1) ? pl->cpuSpeed : NAN; + return totalPercent; } |