Just check hwmon sysfs folder for cpu temp sensors
@@ -929,14 +929,6 @@ static void snapshot_swapchain_frame(struct swapchain_data *data)
if (log_duration_env && !try_stoi(duration, log_duration_env))
duration = 0;
- if (cpu.find("Intel") != std::string::npos) {
- string path;
- if (find_folder("/sys/devices/platform/coretemp.0/hwmon/", "hwmon", path)) {
- path = "/sys/devices/platform/coretemp.0/hwmon/" + path + "/temp1_input";
- if (file_exists(path))
- cpuTempFile = fopen(path.c_str(), "r");
- }
- } else {
string name, path;
string hwmon = "/sys/class/hwmon/";
auto dirs = ls(hwmon.c_str());
@@ -944,18 +936,19 @@ static void snapshot_swapchain_frame(struct swapchain_data *data)
{
path = hwmon + dir;
name = read_line(path + "/name");
+#ifndef NDEBUG
std::cerr << "hwmon: sensor name: " << name << std::endl;
- if (name == "k10temp" || name == "zenpower"){
+#endif
+ if (name == "coretemp" || name == "k10temp" || name == "zenpower"){
path += "/temp1_input";
break;
}
}
if (!file_exists(path)) {
- cout << "MANGOHUD: Could not find temp location" << endl;
+ cerr << "MANGOHUD: Could not find cpu temp sensor location" << endl;
} else {
cpuTempFile = fopen(path.c_str(), "r");
}
- }
sysInfoFetched = true;
}
