Linux: do not scan frequency for inactive CPUs

This commit is contained in:
Christian Göttsche 2021-08-21 23:53:17 +02:00
parent 68f2bfea61
commit 9df0f62859
1 changed files with 3 additions and 0 deletions

View File

@ -1961,6 +1961,9 @@ static int scanCPUFreqencyFromSysCPUFreq(LinuxProcessList* this) {
} }
for (unsigned int i = 0; i < existingCPUs; ++i) { for (unsigned int i = 0; i < existingCPUs; ++i) {
if (!ProcessList_isCPUonline(&this->super, i))
continue;
char pathBuffer[64]; char pathBuffer[64];
xSnprintf(pathBuffer, sizeof(pathBuffer), "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_cur_freq", i); xSnprintf(pathBuffer, sizeof(pathBuffer), "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_cur_freq", i);