Updated htop with latest changes from avafinger (#2171)
- latest changes from avafinger - minus the flashiness - plus fix cpufreq meter on bigLITTLE
This commit is contained in:
parent
b7ef3ca1e0
commit
79096f034f
@ -19,14 +19,8 @@ case "$1" in
|
||||
cpu_cores=$(grep -c '^processor' /proc/cpuinfo | sed 's/^0$/1/')
|
||||
|
||||
# adjust custom htop initial configuration based on CPU count https://github.com/avafinger/htop-2.1.1_enhanced-version
|
||||
right_meters="Hostname Tasks LoadAverage Uptime"
|
||||
right_meter_modes="2 2 2 2"
|
||||
x=1
|
||||
until [ $x -gt $cpu_cores ]; do
|
||||
right_meters=$right_meters" CpuFreq($x)"
|
||||
right_meter_modes=$right_meter_modes" 2"
|
||||
let x+=1
|
||||
done
|
||||
right_meters="Hostname Tasks LoadAverage Uptime CpuFreq"
|
||||
right_meter_modes="2 2 2 2 2"
|
||||
sed -i 's/header_margin=.*/header_margin=1/g' /etc/skel/.config/htop/htoprc
|
||||
sed -i 's/left_meters=.*/left_meters=AllCPUs Memory Swap CpuTemp/g' /etc/skel/.config/htop/htoprc
|
||||
sed -i 's/left_meter_modes=.*/left_meter_modes=1 1 1 2/g' /etc/skel/.config/htop/htoprc
|
||||
|
||||
@ -3,7 +3,7 @@ local package_name="htop"
|
||||
local package_repo="https://github.com/hishamhm/htop"
|
||||
local package_ref="tag:2.2.0"
|
||||
|
||||
local package_upstream_version="2.2.0-4"
|
||||
local package_upstream_version="2.2.0-5"
|
||||
local package_builddeps="debhelper dpkg-dev libhwloc-dev libncurses5-dev libncursesw5-dev pkg-config"
|
||||
local package_install_target="htop"
|
||||
local package_component="${release}-utils"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -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) {
|
||||
@ -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 = {
|
||||
@ -1,5 +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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user