diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-10-23 13:46:21 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-10-23 13:46:21 -0200 |
commit | 71190654bc926fb137e829fb8e2f9efa1e4344ab (patch) | |
tree | 3c7570e7ed4517a129c5d6ff67955964bdb7907c /linux | |
parent | 9c146393a3a8b4470d015066b796cc2807a44142 (diff) |
Calculate CPU averages on Darwin (See #295).
Diffstat (limited to 'linux')
-rw-r--r-- | linux/Platform.c | 16 |
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]; |