summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-10-23 13:46:21 -0200
committerHisham Muhammad <hisham@gobolinux.org>2015-10-23 13:46:21 -0200
commit71190654bc926fb137e829fb8e2f9efa1e4344ab (patch)
tree3c7570e7ed4517a129c5d6ff67955964bdb7907c /linux
parent9c146393a3a8b4470d015066b796cc2807a44142 (diff)
Calculate CPU averages on Darwin (See #295).
Diffstat (limited to 'linux')
-rw-r--r--linux/Platform.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/linux/Platform.c b/linux/Platform.c
index 32f73893..3a919bb1 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -162,15 +162,15 @@ double Platform_setCPUValues(Meter* this, int cpu) {
double total = (double) ( cpuData->totalPeriod == 0 ? 1 : cpuData->totalPeriod);
double percent;
double* v = this->values;
- v[0] = cpuData->nicePeriod / total * 100.0;
- v[1] = cpuData->userPeriod / total * 100.0;
+ v[CPU_METER_NICE] = cpuData->nicePeriod / total * 100.0;
+ v[CPU_METER_NORMAL] = cpuData->userPeriod / total * 100.0;
if (this->pl->settings->detailedCPUTime) {
- v[2] = cpuData->systemPeriod / total * 100.0;
- v[3] = cpuData->irqPeriod / total * 100.0;
- v[4] = cpuData->softIrqPeriod / total * 100.0;
- v[5] = cpuData->stealPeriod / total * 100.0;
- v[6] = cpuData->guestPeriod / total * 100.0;
- v[7] = cpuData->ioWaitPeriod / total * 100.0;
+ v[CPU_METER_KERNEL] = cpuData->systemPeriod / total * 100.0;
+ v[CPU_METER_IRQ] = cpuData->irqPeriod / total * 100.0;
+ v[CPU_METER_SOFTIRQ] = cpuData->softIrqPeriod / total * 100.0;
+ v[CPU_METER_STEAL] = cpuData->stealPeriod / total * 100.0;
+ v[CPU_METER_GUEST] = cpuData->guestPeriod / total * 100.0;
+ v[CPU_METER_IOWAIT] = cpuData->ioWaitPeriod / total * 100.0;
Meter_setItems(this, 8);
if (this->pl->settings->accountGuestInCPUMeter) {
percent = v[0]+v[1]+v[2]+v[3]+v[4]+v[5]+v[6];

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