Files
termux-packages/root-packages/btop/improve-cpu-sensor-guessing.patch
termux-pacman-bot ea9e6a9b63 bump(root/btop): 1.4.6
- Fixes https://github.com/termux/termux-packages/issues/27760

- Rebase `CMakeLists.txt.patch`

- Rebase `disable_pthread.patch`

- Rebase `improve-cpu-sensor-guessing.patch` (after https://github.com/aristocratos/btop/pull/1319, `s_contains()` -> `std::string::contains()` avoids `error: use of undeclared identifier 's_contains'`)
2025-12-29 08:46:25 +00:00

23 lines
738 B
Diff

diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp
index 119dd6a..2ae36e8 100644
--- a/src/linux/btop_collect.cpp
+++ b/src/linux/btop_collect.cpp
@@ -517,6 +517,17 @@ namespace Cpu {
cpu_sensor = name;
break;
}
+
+ // Android frequently has heterogeneous CPUs. Try to grab the sensor for the BIG cores.
+ if (str_to_lower(name).contains("big")) {
+ cpu_sensor = name;
+ break;
+ }
+ // Failing that, grab the first thermal zone so the random pick below doesn't choose the battery or some other chip.
+ if (str_to_lower(name).contains("thermal0/")) {
+ cpu_sensor = name;
+ break;
+ }
}
if (cpu_sensor.empty()) {
cpu_sensor = found_sensors.begin()->first;