summaryrefslogtreecommitdiffstats
path: root/linux/Platform.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-12-01 13:59:19 +0100
committerBenBE <BenBE@geshi.org>2020-12-02 21:03:24 +0100
commitb76eaf187a313c99fe008b069b8123b299752589 (patch)
tree54bc2656cbc1fba7b75cf7bd823f4f0af42d7673 /linux/Platform.c
parentf7a89529330044f4e2a38e85a88ec90f839ae64e (diff)
Dynamically load libsensors at runtime
Diffstat (limited to 'linux/Platform.c')
-rw-r--r--linux/Platform.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/linux/Platform.c b/linux/Platform.c
index 1462f82e..833044b1 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -61,10 +61,11 @@ in the source distribution for its full text.
#include "zfs/ZfsArcStats.h"
#include "zfs/ZfsCompressedArcMeter.h"
-#ifdef HAVE_LIBSENSORS
-#include <sensors/sensors.h>
+#ifdef HAVE_SENSORS_SENSORS_H
+#include "LibSensors.h"
#endif
+
ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_VIRT, M_RESIDENT, (int)M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
int Platform_numberOfFields = LAST_PROCESSFIELD;
@@ -119,14 +120,14 @@ void Platform_init(void) {
exit(1);
}
-#ifdef HAVE_LIBSENSORS
- sensors_init(NULL);
+#ifdef HAVE_SENSORS_SENSORS_H
+ LibSensors_init(NULL);
#endif
}
void Platform_done(void) {
-#ifdef HAVE_LIBSENSORS
- sensors_cleanup();
+#ifdef HAVE_SENSORS_SENSORS_H
+ LibSensors_cleanup();
#endif
}
@@ -271,7 +272,7 @@ double Platform_setCPUValues(Meter* this, int cpu) {
v[CPU_METER_FREQUENCY] = cpuData->frequency;
-#ifdef HAVE_LIBSENSORS
+#ifdef HAVE_SENSORS_SENSORS_H
v[CPU_METER_TEMPERATURE] = cpuData->temperature;
#else
v[CPU_METER_TEMPERATURE] = NAN;

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