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

@ -17,11 +17,18 @@ in the source distribution for its full text.
typedef struct OpenBSDProcess_ {
Process super;
/* 'Kernel virtual addr of u-area' to detect main threads */
uint64_t addr;
} OpenBSDProcess;
#define Process_isKernelThread(_process) (_process->pgrp == 0)
static inline bool Process_isKernelThread(const Process* this) {
return this->pgrp == 0;
}
#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
static inline bool Process_isUserlandThread(const Process* this) {
return this->pid != this->tgid;
}
extern const ProcessClass OpenBSDProcess_class;