From 131a6c6e2bf232ce4c1aca80e4a35a6175e059ba Mon Sep 17 00:00:00 2001 From: senjan Date: Sun, 26 May 2019 21:20:00 +0200 Subject: CPU_KERNEL redefined --- Action.c | 4 ++-- CPUMeter.c | 6 +++--- CRT.c | 14 +++++++------- CRT.h | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Action.c b/Action.c index 9a7c3c56..fbbeee2b 100644 --- a/Action.c +++ b/Action.c @@ -463,7 +463,7 @@ static Htop_Reaction actionHelp(State* st) { if (settings->detailedCPUTime) { addattrstr(CRT_colors[CPU_NICE_TEXT], "low"); addstr("/"); addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/"); - addattrstr(CRT_colors[CPU_KERNEL], "kernel"); addstr("/"); + addattrstr(CRT_colors[CPU_KRNL], "kernel"); addstr("/"); addattrstr(CRT_colors[CPU_IRQ], "irq"); addstr("/"); addattrstr(CRT_colors[CPU_SOFTIRQ], "soft-irq"); addstr("/"); addattrstr(CRT_colors[CPU_STEAL], "steal"); addstr("/"); @@ -473,7 +473,7 @@ static Htop_Reaction actionHelp(State* st) { } else { addattrstr(CRT_colors[CPU_NICE_TEXT], "low-priority"); addstr("/"); addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/"); - addattrstr(CRT_colors[CPU_KERNEL], "kernel"); addstr("/"); + addattrstr(CRT_colors[CPU_KRNL], "kernel"); addstr("/"); addattrstr(CRT_colors[CPU_GUEST], "virtualiz"); addattrstr(CRT_colors[BAR_SHADOW], " used%"); } diff --git a/CPUMeter.c b/CPUMeter.c index de5490df..36c3b2ca 100644 --- a/CPUMeter.c +++ b/CPUMeter.c @@ -34,7 +34,7 @@ typedef enum { }*/ int CPUMeter_attributes[] = { - CPU_NICE, CPU_NORMAL, CPU_KERNEL, CPU_IRQ, CPU_SOFTIRQ, CPU_STEAL, CPU_GUEST, CPU_IOWAIT + CPU_NICE, CPU_NORMAL, CPU_KRNL, CPU_IRQ, CPU_SOFTIRQ, CPU_STEAL, CPU_GUEST, CPU_IOWAIT }; #ifndef MIN @@ -80,7 +80,7 @@ static void CPUMeter_display(Object* cast, RichString* out) { if (this->pl->settings->detailedCPUTime) { xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_KERNEL]); RichString_append(out, CRT_colors[METER_TEXT], "sy:"); - RichString_append(out, CRT_colors[CPU_KERNEL], buffer); + RichString_append(out, CRT_colors[CPU_KRNL], buffer); xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NICE]); RichString_append(out, CRT_colors[METER_TEXT], "ni:"); RichString_append(out, CRT_colors[CPU_NICE_TEXT], buffer); @@ -106,7 +106,7 @@ static void CPUMeter_display(Object* cast, RichString* out) { } else { xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_KERNEL]); RichString_append(out, CRT_colors[METER_TEXT], "sys:"); - RichString_append(out, CRT_colors[CPU_KERNEL], buffer); + RichString_append(out, CRT_colors[CPU_KRNL], buffer); xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NICE]); RichString_append(out, CRT_colors[METER_TEXT], "low:"); RichString_append(out, CRT_colors[CPU_NICE_TEXT], buffer); diff --git a/CRT.c b/CRT.c index ca9a10dd..d46d389c 100644 --- a/CRT.c +++ b/CRT.c @@ -122,7 +122,7 @@ typedef enum ColorElements_ { CPU_NICE, CPU_NICE_TEXT, CPU_NORMAL, - CPU_KERNEL, + CPU_KRNL, CPU_IOWAIT, CPU_IRQ, CPU_SOFTIRQ, @@ -226,7 +226,7 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = { [CPU_NICE] = ColorPair(Blue,Black), [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black), [CPU_NORMAL] = ColorPair(Green,Black), - [CPU_KERNEL] = ColorPair(Red,Black), + [CPU_KRNL] = ColorPair(Red,Black), [CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black), [CPU_IRQ] = ColorPair(Yellow,Black), [CPU_SOFTIRQ] = ColorPair(Magenta,Black), @@ -285,7 +285,7 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = { [CPU_NICE] = A_NORMAL, [CPU_NICE_TEXT] = A_NORMAL, [CPU_NORMAL] = A_BOLD, - [CPU_KERNEL] = A_BOLD, + [CPU_KRNL] = A_BOLD, [CPU_IOWAIT] = A_NORMAL, [CPU_IRQ] = A_BOLD, [CPU_SOFTIRQ] = A_BOLD, @@ -344,7 +344,7 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = { [CPU_NICE] = ColorPair(Cyan,White), [CPU_NICE_TEXT] = ColorPair(Cyan,White), [CPU_NORMAL] = ColorPair(Green,White), - [CPU_KERNEL] = ColorPair(Red,White), + [CPU_KRNL] = ColorPair(Red,White), [CPU_IOWAIT] = A_BOLD | ColorPair(Black, White), [CPU_IRQ] = ColorPair(Blue,White), [CPU_SOFTIRQ] = ColorPair(Blue,White), @@ -403,7 +403,7 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = { [CPU_NICE] = ColorPair(Cyan,Black), [CPU_NICE_TEXT] = ColorPair(Cyan,Black), [CPU_NORMAL] = ColorPair(Green,Black), - [CPU_KERNEL] = ColorPair(Red,Black), + [CPU_KRNL] = ColorPair(Red,Black), [CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black), [CPU_IRQ] = A_BOLD | ColorPair(Blue,Black), [CPU_SOFTIRQ] = ColorPair(Blue,Black), @@ -462,7 +462,7 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = { [CPU_NICE] = A_BOLD | ColorPair(Cyan,Blue), [CPU_NICE_TEXT] = A_BOLD | ColorPair(Cyan,Blue), [CPU_NORMAL] = A_BOLD | ColorPair(Green,Blue), - [CPU_KERNEL] = A_BOLD | ColorPair(Red,Blue), + [CPU_KRNL] = A_BOLD | ColorPair(Red,Blue), [CPU_IOWAIT] = A_BOLD | ColorPair(Blue,Blue), [CPU_IRQ] = A_BOLD | ColorPair(Black,Blue), [CPU_SOFTIRQ] = ColorPair(Black,Blue), @@ -521,7 +521,7 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = { [CPU_NICE] = ColorPair(Blue,Black), [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black), [CPU_NORMAL] = ColorPair(Green,Black), - [CPU_KERNEL] = ColorPair(Red,Black), + [CPU_KRNL] = ColorPair(Red,Black), [CPU_IOWAIT] = ColorPair(Yellow,Black), [CPU_IRQ] = A_BOLD | ColorPair(Blue,Black), [CPU_SOFTIRQ] = ColorPair(Blue,Black), diff --git a/CRT.h b/CRT.h index 933fe068..00331223 100644 --- a/CRT.h +++ b/CRT.h @@ -110,7 +110,7 @@ typedef enum ColorElements_ { CPU_NICE, CPU_NICE_TEXT, CPU_NORMAL, - CPU_KERNEL, + CPU_KRNL, CPU_IOWAIT, CPU_IRQ, CPU_SOFTIRQ, -- cgit v1.2.3 From 423414937b0d1f13b991d6ae0792e0c576841bfb Mon Sep 17 00:00:00 2001 From: senjan Date: Sun, 26 May 2019 21:20:35 +0200 Subject: does not work within NGZ --- solaris/SolarisProcessList.c | 8 +++++--- solaris/SolarisProcessList.h | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/solaris/SolarisProcessList.c b/solaris/SolarisProcessList.c index 2c681852..255f0096 100644 --- a/solaris/SolarisProcessList.c +++ b/solaris/SolarisProcessList.c @@ -25,6 +25,8 @@ in the source distribution for its full text. #define MAXCMDLINE 255 +#define GZONE "global " +#define UZONE "unknown " /*{ #include @@ -62,12 +64,12 @@ typedef struct SolarisProcessList_ { char* SolarisProcessList_readZoneName(kstat_ctl_t* kd, SolarisProcess* sproc) { char* zname; if ( sproc->zoneid == 0 ) { - zname = xStrdup("global "); + zname = xStrdup(GZONE); } else if ( kd == NULL ) { - zname = xStrdup("unknown "); + zname = xStrdup(UZONE); } else { kstat_t* ks = kstat_lookup( kd, "zones", sproc->zoneid, NULL ); - zname = xStrdup(ks->ks_name); + zname = xStrdup(ks == NULL ? UZONE : ks->ks_name); } return zname; } diff --git a/solaris/SolarisProcessList.h b/solaris/SolarisProcessList.h index a5f2fbc2..1729195c 100644 --- a/solaris/SolarisProcessList.h +++ b/solaris/SolarisProcessList.h @@ -12,6 +12,8 @@ in the source distribution for its full text. #define MAXCMDLINE 255 +#define GZONE "global " +#define UZONE "unknown " #include #include -- cgit v1.2.3 From 01a1cc063f6bc5dd5b33d29013301073e3e159e9 Mon Sep 17 00:00:00 2001 From: senjan Date: Thu, 30 May 2019 16:34:30 +0200 Subject: fixed Linux build --- TasksMeter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TasksMeter.c b/TasksMeter.c index f56c8613..23ac8364 100644 --- a/TasksMeter.c +++ b/TasksMeter.c @@ -15,7 +15,7 @@ in the source distribution for its full text. }*/ int TasksMeter_attributes[] = { - CPU_KERNEL, PROCESS_THREAD, PROCESS, TASKS_RUNNING + CPU_KRNL, PROCESS_THREAD, PROCESS, TASKS_RUNNING }; static void TasksMeter_updateValues(Meter* this, char* buffer, int len) { -- cgit v1.2.3