summaryrefslogtreecommitdiffstats
path: root/dragonflybsd
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2024-01-19 20:57:33 +0100
committercgzones <cgzones@googlemail.com>2024-01-20 11:51:47 +0100
commit7639d62459b306af0ba2f1f6d1cc549c6982944d (patch)
treea27b44b0e55f2804ceba0077476033334eec753a /dragonflybsd
parent91990b1a34927a4136a85e4ff9adcdbfa500286a (diff)
DragonFlyBSD: build fixes
Diffstat (limited to 'dragonflybsd')
-rw-r--r--dragonflybsd/DragonFlyBSDMachine.c14
-rw-r--r--dragonflybsd/DragonFlyBSDMachine.h2
-rw-r--r--dragonflybsd/DragonFlyBSDProcessTable.c8
-rw-r--r--dragonflybsd/Platform.c3
4 files changed, 18 insertions, 9 deletions
diff --git a/dragonflybsd/DragonFlyBSDMachine.c b/dragonflybsd/DragonFlyBSDMachine.c
index fd5b58b6..d71778fa 100644
--- a/dragonflybsd/DragonFlyBSDMachine.c
+++ b/dragonflybsd/DragonFlyBSDMachine.c
@@ -119,7 +119,7 @@ Machine* Machine_new(UsersTable* usersTable, uid_t userId) {
}
void Machine_delete(Machine* super) {
- const DragonFlyBSDMachine* this = (const DragonFlyBSDMachine*) super;
+ DragonFlyBSDMachine* this = (DragonFlyBSDMachine*) super;
Machine_done(super);
@@ -223,7 +223,7 @@ static void DragonFlyBSDMachine_scanCPUTime(Machine* super) {
}
static void DragonFlyBSDMachine_scanMemoryInfo(Machine* super) {
- DragonFlyBSDMachine* this = (DragonFlyBSDProcessTable*) super;
+ DragonFlyBSDMachine* this = (DragonFlyBSDMachine*) super;
// @etosan:
// memory counter relationships seem to be these:
@@ -319,7 +319,7 @@ retry:
free(jails);
}
-char* DragonFlyBSDMachine_readJailName(DragonFlyBSDMachine* host, int jailid) {
+char* DragonFlyBSDMachine_readJailName(const DragonFlyBSDMachine* host, int jailid) {
char* hostname;
char* jname;
@@ -339,3 +339,11 @@ void Machine_scan(Machine* super) {
DragonFlyBSDMachine_scanCPUTime(super);
DragonFlyBSDMachine_scanJails(this);
}
+
+bool Machine_isCPUonline(const Machine* host, unsigned int id) {
+ assert(id < host->existingCPUs);
+ (void)host; (void)id;
+
+ // TODO: Support detecting online / offline CPUs.
+ return true;
+}
diff --git a/dragonflybsd/DragonFlyBSDMachine.h b/dragonflybsd/DragonFlyBSDMachine.h
index 0d4d8ef1..31996a0e 100644
--- a/dragonflybsd/DragonFlyBSDMachine.h
+++ b/dragonflybsd/DragonFlyBSDMachine.h
@@ -56,6 +56,6 @@ typedef struct DragonFlyBSDMachine_ {
unsigned long* cp_times_n;
} DragonFlyBSDMachine;
-char* DragonFlyBSDMachine_readJailName(DragonFlyBSDMachine* host, int jailid);
+char* DragonFlyBSDMachine_readJailName(const DragonFlyBSDMachine* host, int jailid);
#endif
diff --git a/dragonflybsd/DragonFlyBSDProcessTable.c b/dragonflybsd/DragonFlyBSDProcessTable.c
index e36086f2..b286219d 100644
--- a/dragonflybsd/DragonFlyBSDProcessTable.c
+++ b/dragonflybsd/DragonFlyBSDProcessTable.c
@@ -37,7 +37,7 @@ ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
}
void ProcessTable_delete(Object* cast) {
- const DragonFlyBSDProcessTable* this = (DragonFlyBSDProcessTable*) cast;
+ DragonFlyBSDProcessTable* this = (DragonFlyBSDProcessTable*) cast;
ProcessTable_done(&this->super);
free(this);
}
@@ -130,8 +130,8 @@ static void DragonFlyBSDProcessTable_updateProcessName(kvm_t* kd, const struct k
}
void ProcessTable_goThroughEntries(ProcessTable* super) {
- const Machine* host = super->host;
- const DragonFlyMachine* dhost = (const DragonFlyMachine*) host;
+ const Machine* host = super->super.host;
+ const DragonFlyBSDMachine* dhost = (const DragonFlyBSDMachine*) host;
const Settings* settings = host->settings;
bool hideKernelThreads = settings->hideKernelThreads;
@@ -216,7 +216,7 @@ void ProcessTable_goThroughEntries(ProcessTable* super) {
proc->time = (kproc->kp_lwp.kl_uticks + kproc->kp_lwp.kl_sticks + kproc->kp_lwp.kl_iticks) / 10000;
proc->percent_cpu = 100.0 * ((double)kproc->kp_lwp.kl_pctcpu / (double)dhost->kernelFScale);
- proc->percent_mem = 100.0 * proc->m_resident / (double)(super->totalMem);
+ proc->percent_mem = 100.0 * proc->m_resident / (double)(super->super.host->totalMem);
Process_updateCPUFieldWidths(proc->percent_cpu);
if (proc->percent_cpu > 0.1) {
diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c
index 25afa8b1..86cda9d8 100644
--- a/dragonflybsd/Platform.c
+++ b/dragonflybsd/Platform.c
@@ -34,6 +34,7 @@ in the source distribution for its full text.
#include "TasksMeter.h"
#include "UptimeMeter.h"
#include "XUtils.h"
+#include "dragonflybsd/DragonFlyBSDMachine.h"
#include "dragonflybsd/DragonFlyBSDProcess.h"
#include "dragonflybsd/DragonFlyBSDProcessTable.h"
#include "generic/fdstat_sysctl.h"
@@ -193,7 +194,7 @@ double Platform_setCPUValues(Meter* this, unsigned int cpu) {
v[CPU_METER_NICE] = cpuData->nicePercent;
v[CPU_METER_NORMAL] = cpuData->userPercent;
- if (super->settings->detailedCPUTime) {
+ if (host->settings->detailedCPUTime) {
v[CPU_METER_KERNEL] = cpuData->systemPercent;
v[CPU_METER_IRQ] = cpuData->irqPercent;
this->curItems = 4;

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