From 9df0f628595f060deee51ffdbaa76e57ffe5c432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sat, 21 Aug 2021 23:53:17 +0200 Subject: [PATCH] Linux: do not scan frequency for inactive CPUs --- linux/LinuxProcessList.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index cd218ceb..90580b71 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1961,6 +1961,9 @@ static int scanCPUFreqencyFromSysCPUFreq(LinuxProcessList* this) { } for (unsigned int i = 0; i < existingCPUs; ++i) { + if (!ProcessList_isCPUonline(&this->super, i)) + continue; + char pathBuffer[64]; xSnprintf(pathBuffer, sizeof(pathBuffer), "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_cur_freq", i);