build/packages/extras-buildpkgs/htop/debian/patches/fix-cpufreq-meter-on-biglittle.patch

30 lines
1.0 KiB
Diff
Raw Normal View History

diff --git a/CpuFreqMeter.c b/CpuFreqMeter.c
index a2f39eb..5436156 100644
--- a/CpuFreqMeter.c
+++ b/CpuFreqMeter.c
@@ -47,9 +47,7 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {
xSnprintf(buf_b, ln, "%4d MHz", Freq);
}
- cpu--;
- if (cpu < 0)
- cpu = 0;
+ cpu = 0;
Freq = Platform_getCpuFreq(this, cpu);
if (Freq > 1000) {
Freq /= 1000;
diff --git a/linux/Platform.c b/linux/Platform.c
index e87089c..cd95463 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -320,8 +320,7 @@ int Platform_getCpuFreq(Meter* this, int cpu) {
}
} else {
// sleep_ms(30);
- // xSnprintf(szbuf, sizeof(szbuf), "/sys/devices/system/cpu/cpufreq/policy%d/cpuinfo_cur_freq", cpu);
- xSnprintf(szbuf, sizeof(szbuf), "%s", "/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq");
+ xSnprintf(szbuf, sizeof(szbuf), "/sys/devices/system/cpu/cpufreq/policy%d/cpuinfo_cur_freq", cpu);
}
fd = fopen(szbuf, "r");
if (fd) {