]> granicus.if.org Git - procps-ng/commitdiff
top: exploit new items for displaying autogroup values
authorJim Warner <james.warner@comcast.net>
Thu, 5 Aug 2021 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Mon, 9 Aug 2021 12:00:23 +0000 (22:00 +1000)
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 <james.warner@comcast.net>
top/top.c
top/top.h
top/top_nls.c

index 07d82e270a6af5e7bbbb526141c3151bbb5c64b8..b0a65f068f0b10ccc285d73d994a9bbd760b0793 100644 (file)
--- 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
index fb2bf96754873fd60c0a0693acad117567221c11..edfbfbf6a5bf8ff17f0339e13fbef3b5df9d76c2 100644 (file)
--- 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
index ede37f07225c9460470bb26ba5a530afed50c69e..db54dc214c72b0e9110bce62002b3749d5664375 100644 (file)
@@ -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");
 }