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/OpenBSDProcess.h | |
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/OpenBSDProcess.h')
-rw-r--r-- | openbsd/OpenBSDProcess.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/openbsd/OpenBSDProcess.h b/openbsd/OpenBSDProcess.h index 6aab29a0..79f9b0fe 100644 --- a/openbsd/OpenBSDProcess.h +++ b/openbsd/OpenBSDProcess.h @@ -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; |