First Commit

This commit is contained in:
leeboby
2020-10-30 09:50:39 +08:00
commit e5f9bb65ac
845 changed files with 177861 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
From 731acc8bced18c90fbe0e18381c32f007f71e0d9 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 10 Apr 2018 16:21:46 +0200
Subject: [PATCH] fix option string
This broke with commit db05ba61065f64b59d0014518be0786b5439e54c.
---
htop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htop.c b/htop.c
index 6db81dd7..678a3b8a 100644
--- a/htop.c
+++ b/htop.c
@@ -93,7 +93,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
int opt, opti=0;
/* Parse arguments */
- while ((opt = getopt_long(argc, argv, "hvCst::d:u:p:i", long_opts, &opti))) {
+ while ((opt = getopt_long(argc, argv, "hvCs:td:u:p:i", long_opts, &opti))) {
if (opt == EOF) break;
switch (opt) {
case 'h':

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
diff --git a/linux/Platform.c b/linux/Platform.c
index bde3e3b..e7e2010 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -175,6 +175,9 @@ int Platform_getCpuTemp() {
if (!fd) {
fd = fopen("/sys/devices/virtual/thermal/thermal_zone0/temp", "r");
}
+ if (!fd) {
+ fd = fopen("/sys/class/hwmon/hwmon0/temp1_input", "r");
+ }
if (fd) {
int n = fscanf(fd, "%d", &Temp);
fclose(fd);

View File

@@ -0,0 +1,29 @@
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) {

View File

@@ -0,0 +1,13 @@
Make sure the auto-regenerated headers (after scripts/MakeHeader.py) actually compile.
--- a/linux/LinuxProcess.c 2018-04-26 18:17:31.349248819 +0200
+++ b/linux/LinuxProcess.c 2018-04-11 02:58:46.994360617 +0200
@@ -143,7 +143,7 @@
} LinuxProcess;
#ifndef Process_isKernelThread
-#define Process_isKernelThread(_process) ((LinuxProcess*)(_process)->isKernelThread)
+#define Process_isKernelThread(_process) (((LinuxProcess*)(_process))->isKernelThread)
#endif
#ifndef Process_isUserlandThread

View File

@@ -0,0 +1,356 @@
diff --git a/BlockDevice_ioStatsMeter.c b/BlockDevice_ioStatsMeter.c
index 9dccbde..95532cd 100644
--- a/BlockDevice_ioStatsMeter.c
+++ b/BlockDevice_ioStatsMeter.c
@@ -26,7 +26,6 @@ static void BlockDevice_sda_ioStatsMeter_setValues(Meter* this, char* buffer, in
char block_device[80];
static double old = 0.;
static double now = 0.;
- static int flash = 0;
static unsigned long sec_size = 0;
FILE *fp;
@@ -81,11 +80,7 @@ static void BlockDevice_sda_ioStatsMeter_setValues(Meter* this, char* buffer, in
Platform_BlockDevice_sda_stats.write_sectors_comp = Platform_BlockDevice_sda_stats.write_sectors;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavailable");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavailable");
}
}
@@ -112,7 +107,6 @@ static void BlockDevice_sdb_ioStatsMeter_setValues(Meter* this, char* buffer, in
char block_device[80];
static double old = 0.;
static double now = 0.;
- static int flash = 0;
static unsigned long sec_size = 0;
FILE *fp;
@@ -167,11 +161,7 @@ static void BlockDevice_sdb_ioStatsMeter_setValues(Meter* this, char* buffer, in
Platform_BlockDevice_sdb_stats.write_sectors_comp = Platform_BlockDevice_sdb_stats.write_sectors;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavailable");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavailable");
}
}
@@ -198,7 +188,6 @@ static void BlockDevice_sdc_ioStatsMeter_setValues(Meter* this, char* buffer, in
char block_device[80];
static double old = 0.;
static double now = 0.;
- static int flash = 0;
static unsigned long sec_size = 0;
FILE *fp;
@@ -253,11 +242,7 @@ static void BlockDevice_sdc_ioStatsMeter_setValues(Meter* this, char* buffer, in
Platform_BlockDevice_sdc_stats.write_sectors_comp = Platform_BlockDevice_sdc_stats.write_sectors;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavailable");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavailable");
}
}
@@ -284,7 +269,6 @@ static void BlockDevice_sdd_ioStatsMeter_setValues(Meter* this, char* buffer, in
char block_device[80];
static double old = 0.;
static double now = 0.;
- static int flash = 0;
static unsigned long sec_size = 0;
FILE *fp;
@@ -339,11 +323,7 @@ static void BlockDevice_sdd_ioStatsMeter_setValues(Meter* this, char* buffer, in
Platform_BlockDevice_sdd_stats.write_sectors_comp = Platform_BlockDevice_sdd_stats.write_sectors;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavailable");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavailable");
}
}
@@ -370,7 +350,6 @@ static void BlockDevice_mmcblk0_ioStatsMeter_setValues(Meter* this, char* buffer
char block_device[80];
static double old = 0.;
static double now = 0.;
- static int flash = 0;
static unsigned long sec_size = 0;
FILE *fp;
@@ -425,11 +404,7 @@ static void BlockDevice_mmcblk0_ioStatsMeter_setValues(Meter* this, char* buffer
Platform_BlockDevice_mmcblk0_stats.write_sectors_comp = Platform_BlockDevice_mmcblk0_stats.write_sectors;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavailable");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavailable");
}
}
@@ -456,7 +431,6 @@ static void BlockDevice_mmcblk1_ioStatsMeter_setValues(Meter* this, char* buffer
char block_device[80];
static double old = 0.;
static double now = 0.;
- static int flash = 0;
static unsigned long sec_size = 0;
FILE *fp;
@@ -511,11 +485,7 @@ static void BlockDevice_mmcblk1_ioStatsMeter_setValues(Meter* this, char* buffer
Platform_BlockDevice_mmcblk1_stats.write_sectors_comp = Platform_BlockDevice_mmcblk1_stats.write_sectors;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavailable");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavailable");
}
}
@@ -542,7 +512,6 @@ static void BlockDevice_mmcblk2_ioStatsMeter_setValues(Meter* this, char* buffer
char block_device[80];
static double old = 0.;
static double now = 0.;
- static int flash = 0;
static unsigned long sec_size = 0;
FILE *fp;
@@ -597,11 +566,7 @@ static void BlockDevice_mmcblk2_ioStatsMeter_setValues(Meter* this, char* buffer
Platform_BlockDevice_mmcblk2_stats.write_sectors_comp = Platform_BlockDevice_mmcblk2_stats.write_sectors;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavailable");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavailable");
}
}
@@ -628,7 +593,6 @@ static void BlockDevice_mmcblk3_ioStatsMeter_setValues(Meter* this, char* buffer
char block_device[80];
static double old = 0.;
static double now = 0.;
- static int flash = 0;
static unsigned long sec_size = 0;
FILE *fp;
@@ -683,11 +647,7 @@ static void BlockDevice_mmcblk3_ioStatsMeter_setValues(Meter* this, char* buffer
Platform_BlockDevice_mmcblk3_stats.write_sectors_comp = Platform_BlockDevice_mmcblk3_stats.write_sectors;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavailable");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavailable");
}
}
diff --git a/CpuFreqMeter.c b/CpuFreqMeter.c
index 6508180..a2f39eb 100644
--- a/CpuFreqMeter.c
+++ b/CpuFreqMeter.c
@@ -23,7 +23,6 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {
char buf_b[32];
char buf_l[32];
int ln = sizeof(buf_l);
- static int pulse = 0;
memset(buf_l, 0, sizeof(buf_l));
memset(buf_b, 0, sizeof(buf_b));
@@ -66,11 +65,7 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {
xSnprintf(buf_l, ln, "%4d MHz", Freq);
}
- if (pulse)
- xSnprintf(buffer, len, "%s %s (big.LITTLE)", buf_b, buf_l, pulse);
- else
- xSnprintf(buffer, len, "%s %s ", buf_b, buf_l, pulse);
- pulse = !pulse;
+ xSnprintf(buffer, len, "%s %s (big.LITTLE)", buf_b, buf_l);
return;
}
@@ -89,7 +84,6 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {
} else {
xSnprintf(buffer, len, "%4d MHz", Freq);
}
- pulse = !pulse;
}
MeterClass CpuFreqMeter_class = {
diff --git a/Eth0_Meter.c b/Eth0_Meter.c
index 90e512a..21e4b05 100644
--- a/Eth0_Meter.c
+++ b/Eth0_Meter.c
@@ -35,11 +35,10 @@ static void Eth0_Meter_setValues(Meter* this, char* buffer, int len) {
ret = findIP_interface("eth0", szIP, sizeof(szIP));
}
- if (ret) {
- xSnprintf(buffer, len, "%s", szIP);
- } else {
- xSnprintf(buffer, len, "%s", "down");
+ if (!ret) {
+ snprintf(szIP, sizeof(szIP), "%s", "down");
}
+ xSnprintf(buffer, len, "%s", szIP);
}
MeterClass Eth0_Meter_class = {
diff --git a/Eth0_StatsMeter.c b/Eth0_StatsMeter.c
index 974c656..1a42334 100644
--- a/Eth0_StatsMeter.c
+++ b/Eth0_StatsMeter.c
@@ -27,7 +27,6 @@ static void Eth0_StatsMeter_setValues(Meter* this, char* buffer, int len) {
double refreshdelay;
static double old = 0.;
static double now = 0.;
- static int flash = 0;
now = get_wall_time();
refreshdelay = now - old;
@@ -57,11 +56,7 @@ static void Eth0_StatsMeter_setValues(Meter* this, char* buffer, int len) {
Platform_Eth0_stats.tx_bytes_comp = Platform_Eth0_stats.tx_bytes;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavail");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavail");
}
}
diff --git a/Eth1_Meter.c b/Eth1_Meter.c
index 41cfa05..181370f 100644
--- a/Eth1_Meter.c
+++ b/Eth1_Meter.c
@@ -35,11 +35,10 @@ static void Eth1_Meter_setValues(Meter* this, char* buffer, int len) {
ret = findIP_interface("eth1", szIP, sizeof(szIP));
}
- if (ret) {
- xSnprintf(buffer, len, "%s", szIP);
- } else {
- xSnprintf(buffer, len, "%s", "down");
+ if (!ret) {
+ snprintf(szIP, sizeof(szIP), "%s", "down");
}
+ xSnprintf(buffer, len, "%s", szIP);
}
MeterClass Eth1_Meter_class = {
diff --git a/Eth1_StatsMeter.c b/Eth1_StatsMeter.c
index 85e6dc9..e7c5718 100644
--- a/Eth1_StatsMeter.c
+++ b/Eth1_StatsMeter.c
@@ -27,7 +27,6 @@ static void Eth1_StatsMeter_setValues(Meter* this, char* buffer, int len) {
double refreshdelay;
static double old = 0.;
static double now = 0.;
- static int flash = 0;
now = get_wall_time();
refreshdelay = now - old;
@@ -57,11 +56,7 @@ static void Eth1_StatsMeter_setValues(Meter* this, char* buffer, int len) {
Platform_Eth1_stats.tx_bytes_comp = Platform_Eth1_stats.tx_bytes;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavail");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavail");
}
}
diff --git a/Wlan0_Meter.c b/Wlan0_Meter.c
index bf75623..8296a6c 100644
--- a/Wlan0_Meter.c
+++ b/Wlan0_Meter.c
@@ -33,11 +33,10 @@ static void Wlan0_Meter_setValues(Meter* this, char* buffer, int len) {
ret = findIP_interface("wlan0", szIP, sizeof(szIP));
}
- if (ret) {
- xSnprintf(buffer, len, "%s", szIP);
- } else {
- xSnprintf(buffer, len, "%s", "down");
+ if (!ret) {
+ snprintf(szIP, sizeof(szIP), "%s", "down");
}
+ xSnprintf(buffer, len, "%s", szIP);
}
MeterClass Wlan0_Meter_class = {
diff --git a/Wlan0_StatsMeter.c b/Wlan0_StatsMeter.c
index f920f9c..9ced108 100644
--- a/Wlan0_StatsMeter.c
+++ b/Wlan0_StatsMeter.c
@@ -27,7 +27,6 @@ static void Wlan0_StatsMeter_setValues(Meter* this, char* buffer, int len) {
double refreshdelay;
static double old = 0.;
static double now = 0.;
- static int flash = 0;
now = get_wall_time();
refreshdelay = now - old;
@@ -57,11 +56,7 @@ static void Wlan0_StatsMeter_setValues(Meter* this, char* buffer, int len) {
Platform_Wlan0_stats.tx_bytes_comp = Platform_Wlan0_stats.tx_bytes;
} else {
- if (!(flash % 2))
- xSnprintf(buffer, len, "%s", "unavail");
- else
- xSnprintf(buffer, len, "%s", "");
- flash++;
+ xSnprintf(buffer, len, "%s", "unavail");
}
}
diff --git a/Wlan1_Meter.c b/Wlan1_Meter.c
index c5acd69..4c5fcea 100644
--- a/Wlan1_Meter.c
+++ b/Wlan1_Meter.c
@@ -35,11 +35,10 @@ static void Wlan1_Meter_setValues(Meter* this, char* buffer, int len) {
ret = findIP_interface("wlan1", szIP, sizeof(szIP));
}
- if (ret) {
- xSnprintf(buffer, len, "%s", szIP);
- } else {
- xSnprintf(buffer, len, "%s", "down");
+ if (!ret) {
+ snprintf(szIP, sizeof(szIP), "%s", "down");
}
+ xSnprintf(buffer, len, "%s", szIP);
}
MeterClass Wlan1_Meter_class = {

View File

@@ -0,0 +1,7 @@
780-fix-option-string.patch
fix-linux-process.patch
avafinger-cpu-monitor.patch
remove-fancy-flashing.patch
fix-cpufreq-meter-on-biglittle.patch
cpu-temperatute-from-hwmon.patch