mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-14 04:54:37 +03:00
Rework CPU counting
Currently htop does not support offline CPUs and hot-swapping, e.g. via echo 0 > /sys/devices/system/cpu/cpu2/online Split the current single cpuCount variable into activeCPUs and existingCPUs. Supersedes: #650 Related: #580
This commit is contained in:

committed by
Benny Baumann

parent
c9abd788b1
commit
41af31be7f
@ -94,9 +94,9 @@ const PanelClass AvailableMetersPanel_class = {
|
||||
|
||||
// Handle (&CPUMeter_class) entries in the AvailableMetersPanel
|
||||
static void AvailableMetersPanel_addCPUMeters(Panel* super, const MeterClass* type, const ProcessList* pl) {
|
||||
if (pl->cpuCount > 1) {
|
||||
if (pl->existingCPUs > 1) {
|
||||
Panel_add(super, (Object*) ListItem_new("CPU average", 0));
|
||||
for (unsigned int i = 1; i <= pl->cpuCount; i++) {
|
||||
for (unsigned int i = 1; i <= pl->existingCPUs; i++) {
|
||||
char buffer[50];
|
||||
xSnprintf(buffer, sizeof(buffer), "%s %d", type->uiName, Settings_cpuId(pl->settings, i - 1));
|
||||
Panel_add(super, (Object*) ListItem_new(buffer, i));
|
||||
|
Reference in New Issue
Block a user