From cfa553883259a3741abd37287b6f6fc737f2a505 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Sun, 6 Mar 2022 00:00:00 -0600 Subject: [PATCH] top: and for symmetry 'UTILIZATION_C' is newest column This commit just compliments a change referenced below by providing the value which includes reaped children. Reference(s): . Feb, 2022 - added %CUU field commit 7647e96b0a35d473fa9bc644ea6107487b3b0527 Signed-off-by: Jim Warner --- top/top.c | 8 +++++--- top/top.h | 2 +- top/top_nls.c | 9 ++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/top/top.c b/top/top.c index 09a4b9f4..8d0214d2 100644 --- a/top/top.c +++ b/top/top.c @@ -1855,9 +1855,10 @@ static struct { { 5, -1, A_right, PIDS_AUTOGRP_ID }, // s_int EU_AGI { 4, -1, A_right, PIDS_AUTOGRP_NICE }, // s_int EU_AGN { 7, -1, A_right, PIDS_TICS_BEGAN }, // ull_int EU_TM3 + { 7, -1, A_right, PIDS_TIME_ELAPSED }, // real EU_TM4 { 6, -1, A_right, PIDS_UTILIZATION }, // real EU_CUU - { 7, -1, A_right, PIDS_TIME_ELAPSED } // real EU_TM4 -#define eu_LAST EU_TM4 + { 6, -1, A_right, PIDS_UTILIZATION_C } // real EU_CUC +#define eu_LAST EU_CUC // xtra Fieldstab 'pseudo pflag' entries for the newlib interface . . . . . . . #define eu_CMDLINE eu_LAST +1 #define eu_TICS_ALL_C eu_LAST +2 @@ -6264,11 +6265,12 @@ static const char *task_show (const WIN_t *q, int idx) { break; /* ull_int, scale_pcnt for 'utilization' */ case EU_CUU: // PIDS_UTILIZATION + case EU_CUC: // PIDS_UTILIZATION_C if (Restrict_some) { cp = justify_pad("?", W, Jn); break; } - cp = scale_pcnt(rSv(EU_CUU, real), W, Jn, 1); + cp = scale_pcnt(rSv(i, real), W, Jn, 1); break; /* u_int, make_num with auto width */ case EU_GID: // PIDS_ID_EGID diff --git a/top/top.h b/top/top.h index 1a564e7f..7ba44df4 100644 --- a/top/top.h +++ b/top/top.h @@ -205,7 +205,7 @@ enum pflag { EU_RSS, EU_PSS, EU_PZA, EU_PZF, EU_PZS, EU_USS, EU_IRB, EU_IRO, EU_IWB, EU_IWO, EU_AGI, EU_AGN, - EU_TM3, EU_CUU, EU_TM4, + EU_TM3, EU_TM4, EU_CUU, EU_CUC, #ifdef USE_X_COLHDR // not really pflags, used with tbl indexing EU_MAXPFLGS diff --git a/top/top_nls.c b/top/top_nls.c index d7ddcf33..92f12bac 100644 --- a/top/top_nls.c +++ b/top/top_nls.c @@ -353,12 +353,15 @@ static void build_two_nlstabs (void) { /* Translation Hint: maximum 'STARTED' = 7 */ Head_nlstab[EU_TM3] = _("STARTED"); Desc_nlstab[EU_TM3] = _("Start Time from boot"); -/* Translation Hint: maximum '%CUU' = 6 */ - Head_nlstab[EU_CUU] = _("%CUU"); - Desc_nlstab[EU_CUU] = _("CPU Utilization"); /* Translation Hint: maximum 'ELAPSED' = 7 */ Head_nlstab[EU_TM4] = _("ELAPSED"); Desc_nlstab[EU_TM4] = _("Elapsed Running Time"); +/* Translation Hint: maximum '%CUU' = 6 */ + Head_nlstab[EU_CUU] = _("%CUU"); + Desc_nlstab[EU_CUU] = _("CPU Utilization"); +/* Translation Hint: maximum '%CUC' = 6 */ + Head_nlstab[EU_CUC] = _("%CUC"); + Desc_nlstab[EU_CUC] = _("Utilization + child"); }