summaryrefslogtreecommitdiffstats
path: root/linux/LinuxProcessList.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-12-13 16:46:10 +0100
committerBenBE <BenBE@geshi.org>2020-12-14 21:07:07 +0100
commitc9583c692da90f58f0d885864d7374e21ef385b6 (patch)
tree76a20a49171d793a4984a456e4dbf3e73c4f6c58 /linux/LinuxProcessList.c
parent4507911cc3b5d5abc605c79cdf0b17290d825380 (diff)
Handle absence of package CPU temperature
Resolves: #389
Diffstat (limited to 'linux/LinuxProcessList.c')
-rw-r--r--linux/LinuxProcessList.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index 45161290..b58afa35 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -1832,41 +1832,6 @@ static void LinuxProcessList_scanCPUFrequency(LinuxProcessList* this) {
scanCPUFreqencyFromCPUinfo(this);
}
-#ifdef HAVE_SENSORS_SENSORS_H
-static void LinuxProcessList_scanCPUTemperature(LinuxProcessList* this) {
- const int cpuCount = this->super.cpuCount;
-
- for (int i = 0; i <= cpuCount; i++) {
- this->cpus[i].temperature = NAN;
- }
-
- int r = LibSensors_getCPUTemperatures(this->cpus, cpuCount);
-
- /* No temperature - nothing to do */
- if (r <= 0)
- return;
-
- /* Only package temperature - copy to all cpus */
- if (r == 1 && !isnan(this->cpus[0].temperature)) {
- double packageTemp = this->cpus[0].temperature;
- for (int i = 1; i <= cpuCount; i++) {
- this->cpus[i].temperature = packageTemp;
- }
-
- return;
- }
-
- /* Half the temperatures, probably HT/SMT - copy to second half */
- if (r >= 2 && (r - 1) == (cpuCount / 2)) {
- for (int i = cpuCount / 2 + 1; i <= cpuCount; i++) {
- this->cpus[i].temperature = this->cpus[i/2].temperature;
- }
-
- return;
- }
-}
-#endif
-
void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
LinuxProcessList* this = (LinuxProcessList*) super;
const Settings* settings = super->settings;
@@ -1884,7 +1849,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
#ifdef HAVE_SENSORS_SENSORS_H
if (settings->showCPUTemperature)
- LinuxProcessList_scanCPUTemperature(this);
+ LibSensors_getCPUTemperatures(this->cpus, this->super.cpuCount);
#endif
// in pause mode only gather global data for meters (CPU/memory/...)

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