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
This commit is contained in:
Christian Göttsche
2021-03-19 17:34:12 +01:00
parent 58ad020aca
commit e4e3f6c390
5 changed files with 60 additions and 16 deletions

View File

@ -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;
}