Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong
GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/packages/extras-buildpkgs/htop/debian/patches/fix-cpufreq-meter-on-biglittle.patch
8661 views
1
diff --git a/CpuFreqMeter.c b/CpuFreqMeter.c
2
index a2f39eb..5436156 100644
3
--- a/CpuFreqMeter.c
4
+++ b/CpuFreqMeter.c
5
@@ -47,9 +47,7 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {
6
xSnprintf(buf_b, ln, "%4d MHz", Freq);
7
}
8
9
- cpu--;
10
- if (cpu < 0)
11
- cpu = 0;
12
+ cpu = 0;
13
Freq = Platform_getCpuFreq(this, cpu);
14
if (Freq > 1000) {
15
Freq /= 1000;
16
diff --git a/linux/Platform.c b/linux/Platform.c
17
index e87089c..cd95463 100644
18
--- a/linux/Platform.c
19
+++ b/linux/Platform.c
20
@@ -320,8 +320,7 @@ int Platform_getCpuFreq(Meter* this, int cpu) {
21
}
22
} else {
23
// sleep_ms(30);
24
- // xSnprintf(szbuf, sizeof(szbuf), "/sys/devices/system/cpu/cpufreq/policy%d/cpuinfo_cur_freq", cpu);
25
- xSnprintf(szbuf, sizeof(szbuf), "%s", "/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq");
26
+ xSnprintf(szbuf, sizeof(szbuf), "/sys/devices/system/cpu/cpufreq/policy%d/cpuinfo_cur_freq", cpu);
27
}
28
fd = fopen(szbuf, "r");
29
if (fd) {
30
31