mirror of https://github.com/xzeldon/htop.git
Fix FreeBSD CPU% calculation
This commit is contained in:
parent
d753996b96
commit
f554f08fa9
|
@ -163,15 +163,15 @@ double Platform_setCPUValues(Meter* this, int cpu) {
|
||||||
double percent;
|
double percent;
|
||||||
double* v = this->values;
|
double* v = this->values;
|
||||||
|
|
||||||
v[CPU_METER_NICE] = cpuData->nicePercent;
|
v[CPU_METER_NICE] = cpuData->nicePercent * cpus;
|
||||||
v[CPU_METER_NORMAL] = cpuData->userPercent;
|
v[CPU_METER_NORMAL] = cpuData->userPercent * cpus;
|
||||||
if (this->pl->settings->detailedCPUTime) {
|
if (this->pl->settings->detailedCPUTime) {
|
||||||
v[CPU_METER_KERNEL] = cpuData->systemPercent;
|
v[CPU_METER_KERNEL] = cpuData->systemPercent * cpus;
|
||||||
v[CPU_METER_IRQ] = cpuData->irqPercent;
|
v[CPU_METER_IRQ] = cpuData->irqPercent * cpus;
|
||||||
Meter_setItems(this, 4);
|
Meter_setItems(this, 4);
|
||||||
percent = v[0]+v[1]+v[2]+v[3];
|
percent = v[0]+v[1]+v[2]+v[3];
|
||||||
} else {
|
} else {
|
||||||
v[2] = cpuData->systemAllPercent;
|
v[2] = cpuData->systemAllPercent * cpus;
|
||||||
Meter_setItems(this, 3);
|
Meter_setItems(this, 3);
|
||||||
percent = v[0]+v[1]+v[2];
|
percent = v[0]+v[1]+v[2];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue