mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-14 21:14:35 +03:00
Added platform dependent DEFAULT_SIGNAL define, for now for:
FreeBSD Linux Other platforms will have it undefined for now.
This commit is contained in:
@ -32,6 +32,11 @@ in the source distribution for its full text.
|
||||
#include "BatteryMeter.h"
|
||||
#include "LinuxProcess.h"
|
||||
#include "SignalsPanel.h"
|
||||
|
||||
#ifndef DEFAULT_SIGNAL
|
||||
#define DEFAULT_SIGNAL 16
|
||||
#endif
|
||||
|
||||
}*/
|
||||
|
||||
ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
|
||||
@ -176,14 +181,14 @@ double Platform_setCPUValues(Meter* this, int cpu) {
|
||||
percent = v[0]+v[1]+v[2]+v[3]+v[4]+v[5]+v[6];
|
||||
} else {
|
||||
percent = v[0]+v[1]+v[2]+v[3]+v[4];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
v[2] = cpuData->systemAllPeriod / total * 100.0;
|
||||
v[3] = (cpuData->stealPeriod + cpuData->guestPeriod) / total * 100.0;
|
||||
Meter_setItems(this, 4);
|
||||
percent = v[0]+v[1]+v[2]+v[3];
|
||||
}
|
||||
percent = MIN(100.0, MAX(0.0, percent));
|
||||
percent = MIN(100.0, MAX(0.0, percent));
|
||||
if (isnan(percent)) percent = 0.0;
|
||||
return percent;
|
||||
}
|
||||
|
Reference in New Issue
Block a user