From 4c30742d412cf552de22b3746a68cd62bfe867f2 Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Mon, 18 Oct 2021 10:08:01 +0200 Subject: comments about temp sensors --- src/osx/sensors.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/osx/sensors.cpp b/src/osx/sensors.cpp index ce3b78c..851b284 100644 --- a/src/osx/sensors.cpp +++ b/src/osx/sensors.cpp @@ -44,7 +44,7 @@ CFDictionaryRef matching(int page, int usage) { double getValue(IOHIDServiceClientRef sc) { IOHIDEventRef event = IOHIDServiceClientCopyEvent(sc, kIOHIDEventTypeTemperature, 0, 0); // here we use ...CopyEvent - double temp = 0.0; + IOHIDFloat temp = 0.0; if (event != 0) { temp = IOHIDEventGetFloatValue(event, IOHIDEventFieldBase(kIOHIDEventTypeTemperature)); CFRelease(event); @@ -72,12 +72,19 @@ unordered_flat_map Cpu::ThermalSensors::getSensors() { char buf[200]; CFStringGetCString(name, buf, 200, kCFStringEncodingASCII); std::string n(buf); - if (n.starts_with("PMU tdie")) { + if (n.starts_with("PMU tdie")) { + // this is just a guess, nobody knows which sensors mean what + // on my system PMU tdie 3 and 9 are missing... + // there is also PMU tdev1-8 but it has negative values?? + // there is also eACC for efficiency package but it only has 2 entries + // and pACC for performance but it has 7 entries (2 - 9) WTF std::string indexString = n.substr(8, 1); int index = stoi(indexString); cpuValues[index - 1] = getValue(sc); + Logger::debug("T " + n + "=" + std::to_string(cpuValues[index - 1])); } else if (n == "SOC MTR Temp Sensor0") { - cpuValues[0] = getValue(sc); // package T for Apple Silicon + // package T for Apple Silicon - also a guess + cpuValues[0] = getValue(sc); } CFRelease(name); } -- cgit v1.2.3