From b789b46f84da590a39afd8d74c76c2f5e5436d40 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Thu, 5 Aug 2021 00:00:00 -0500 Subject: [PATCH] top: exploit new items for displaying autogroup values Ordinarily, whenever a new field is added to top, that RCF_VERSION_ID should be bumped which then prevents an older version of top from reading the expanded rcfile. With this change, however, we'll keep the existing 'k' version since we've yet to release the newlib version. Signed-off-by: Jim Warner --- top/top.c | 8 ++++++-- top/top.h | 1 + top/top_nls.c | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/top/top.c b/top/top.c index 07d82e27..b0a65f06 100644 --- a/top/top.c +++ b/top/top.c @@ -1692,8 +1692,10 @@ static struct { { 6, -1, A_right, PIDS_IO_READ_BYTES }, // ul_int EU_IRB { 5, -1, A_right, PIDS_IO_READ_OPS }, // ul_int EU_IRO { 6, -1, A_right, PIDS_IO_WRITE_BYTES }, // ul_int EU_IWB - { 5, -1, A_right, PIDS_IO_WRITE_OPS } // ul_int EU_IWO -#define eu_LAST EU_IWO + { 5, -1, A_right, PIDS_IO_WRITE_OPS }, // ul_int EU_IWO + { 5, -1, A_right, PIDS_AUTOGRP_ID }, // s_int EU_AGI + { 4, -1, A_right, PIDS_AUTOGRP_NICE } // s_int EU_AGN +#define eu_LAST EU_AGN // xtra Fieldstab 'pseudo pflag' entries for the newlib interface . . . . . . . #define eu_CMDLINE eu_LAST +1 #define eu_TICS_ALL_C eu_LAST +2 @@ -5894,6 +5896,7 @@ static const char *task_show (const WIN_t *q, int idx) { cp = make_num(rSv(EU_LID, s_int), W, Jn, EU_LID, 0); break; /* s_int, make_num without auto width */ + case EU_AGI: // PIDS_AUTOGRP_ID case EU_NMA: // PIDS_PROCESSOR_NODE case EU_PGD: // PIDS_ID_PGRP case EU_PID: // PIDS_ID_PID @@ -5905,6 +5908,7 @@ static const char *task_show (const WIN_t *q, int idx) { cp = make_num(rSv(i, s_int), W, Jn, AUTOX_NO, 0); break; /* s_int, make_num without auto width, but with zero supression */ + case EU_AGN: // PIDS_AUTOGRP_NICE case EU_NCE: // PIDS_NICE case EU_OOA: // PIDS_OOM_ADJ case EU_OOM: // PIDS_OOM_SCORE diff --git a/top/top.h b/top/top.h index fb2bf967..edfbfbf6 100644 --- a/top/top.h +++ b/top/top.h @@ -195,6 +195,7 @@ enum pflag { EU_EXE, EU_RSS, EU_PSS, EU_PZA, EU_PZF, EU_PZS, EU_USS, EU_IRB, EU_IRO, EU_IWB, EU_IWO, + EU_AGI, EU_AGN, #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 ede37f07..db54dc21 100644 --- a/top/top_nls.c +++ b/top/top_nls.c @@ -344,6 +344,12 @@ static void build_two_nlstabs (void) { /* Translation Hint: maximum 'ioWop' = 5 */ Head_nlstab[EU_IWO] = _("ioWop"); Desc_nlstab[EU_IWO] = _("I/O Write Operations"); +/* Translation Hint: maximum 'AGID' = 5 */ + Head_nlstab[EU_AGI] = _("AGID"); + Desc_nlstab[EU_AGI] = _("Autogroup Identifier"); +/* Translation Hint: maximum 'AGNI' = 4 */ + Head_nlstab[EU_AGN] = _("AGNI"); + Desc_nlstab[EU_AGN] = _("Autogroup Nice Value"); }