summaryrefslogtreecommitdiffstats
path: root/AffinityPanel.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-06-12 22:04:37 +0200
committerBenny Baumann <BenBE@geshi.org>2021-07-18 07:47:09 +0200
commit11d2206f40dd1680923ccae6e421a494c2af0992 (patch)
tree76513a64006184ee1bfc59ce9fa4aab1b0a2fc43 /AffinityPanel.c
parent41af31be7ffbd34518b27aad56a4f54af6a8adf3 (diff)
Add ProcessList_isCPUonline
Diffstat (limited to 'AffinityPanel.c')
-rw-r--r--AffinityPanel.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/AffinityPanel.c b/AffinityPanel.c
index 56d8d89c..dbce5ca0 100644
--- a/AffinityPanel.c
+++ b/AffinityPanel.c
@@ -384,7 +384,9 @@ Panel* AffinityPanel_new(ProcessList* pl, const Affinity* affinity, int* width)
unsigned int curCpu = 0;
for (unsigned int i = 0; i < pl->existingCPUs; i++) {
- /* TODO: skip offline CPUs */
+ if (!ProcessList_isCPUonline(this->pl, i))
+ continue;
+
char number[16];
xSnprintf(number, 9, "CPU %d", Settings_cpuId(pl->settings, i));
unsigned cpu_width = 4 + strlen(number);
@@ -428,8 +430,7 @@ Affinity* AffinityPanel_getAffinity(Panel* super, ProcessList* pl) {
Affinity_add(affinity, i);
hwloc_bitmap_foreach_end();
#else
- for (unsigned int i = 0; i < this->pl->existingCPUs; i++) {
- /* TODO: skip offline CPUs */
+ for (int i = 0; i < Vector_size(this->cpuids); i++) {
const MaskItem* item = (const MaskItem*)Vector_get(this->cpuids, i);
if (item->value) {
Affinity_add(affinity, item->cpu);

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