top: bring the namespaces up to date with linux kernel

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2022-05-05 00:00:00 -05:00 committed by Craig Small
parent d1ae5276e9
commit 371e9138ba
3 changed files with 23 additions and 6 deletions

View File

@ -1892,8 +1892,10 @@ static struct {
{ 7, -1, A_right, PIDS_TICS_BEGAN }, // ull_int EU_TM3 { 7, -1, A_right, PIDS_TICS_BEGAN }, // ull_int EU_TM3
{ 7, -1, A_right, PIDS_TIME_ELAPSED }, // real EU_TM4 { 7, -1, A_right, PIDS_TIME_ELAPSED }, // real EU_TM4
{ 6, -1, A_right, PIDS_UTILIZATION }, // real EU_CUU { 6, -1, A_right, PIDS_UTILIZATION }, // real EU_CUU
{ 7, -1, A_right, PIDS_UTILIZATION_C } // real EU_CUC { 7, -1, A_right, PIDS_UTILIZATION_C }, // real EU_CUC
#define eu_LAST EU_CUC { 10, -1, A_right, PIDS_NS_CGROUP }, // ul_int EU_NS7
{ 10, -1, A_right, PIDS_NS_TIME } // ul_int EU_NS8
#define eu_LAST EU_NS8
// xtra Fieldstab 'pseudo pflag' entries for the newlib interface . . . . . . . // xtra Fieldstab 'pseudo pflag' entries for the newlib interface . . . . . . .
#define eu_CMDLINE eu_LAST +1 #define eu_CMDLINE eu_LAST +1
#define eu_TICS_ALL_C eu_LAST +2 #define eu_TICS_ALL_C eu_LAST +2
@ -2283,7 +2285,7 @@ static void display_fields (int focus, int extend) {
note: width passed to 'utf8_embody' may go negative, but he'll be just fine */ note: width passed to 'utf8_embody' may go negative, but he'll be just fine */
snprintf(sbuf, sizeof(sbuf), "= %.*s", utf8_embody(N_fld(f), smax - xEQUS), N_fld(f)); snprintf(sbuf, sizeof(sbuf), "= %.*s", utf8_embody(N_fld(f), smax - xEQUS), N_fld(f));
// obtain translated deltas (if any) ... // obtain translated deltas (if any) ...
xcol = utf8_delta(fmtmk("%.*s", utf8_embody(N_col(f), 7), N_col(f))); xcol = utf8_delta(fmtmk("%.*s", utf8_embody(N_col(f), 8), N_col(f)));
xfld = utf8_delta(sbuf + xEQUS); // ignore beginning '= ' xfld = utf8_delta(sbuf + xEQUS); // ignore beginning '= '
PUTT("%s%c%s%s %s%-*.*s%s%s%s %-*.*s%s" PUTT("%s%c%s%s %s%-*.*s%s%s%s %-*.*s%s"
@ -2292,7 +2294,7 @@ static void display_fields (int focus, int extend) {
, b ? w->cap_bold : Cap_norm , b ? w->cap_bold : Cap_norm
, e , e
, i == focus ? w->capclr_hdr : "" , i == focus ? w->capclr_hdr : ""
, 7 + xcol, 7 + xcol , 8 + xcol, 8 + xcol
, N_col(f) , N_col(f)
, Cap_norm , Cap_norm
, b ? w->cap_bold : "" , b ? w->cap_bold : ""
@ -2456,7 +2458,8 @@ static void zap_fieldstab (void) {
= wtab[EU_GID].watx = wtab[EU_GRP].watx = wtab[EU_TTY].watx = wtab[EU_GID].watx = wtab[EU_GRP].watx = wtab[EU_TTY].watx
= wtab[EU_WCH].watx = wtab[EU_NS1].watx = wtab[EU_NS2].watx = wtab[EU_WCH].watx = wtab[EU_NS1].watx = wtab[EU_NS2].watx
= wtab[EU_NS3].watx = wtab[EU_NS4].watx = wtab[EU_NS5].watx = wtab[EU_NS3].watx = wtab[EU_NS4].watx = wtab[EU_NS5].watx
= wtab[EU_NS6].watx = wtab[EU_LXC].watx = wtab[EU_LID].watx = wtab[EU_NS6].watx = wtab[EU_NS7].watx = wtab[EU_NS8].watx
= wtab[EU_LXC].watx = wtab[EU_LID].watx
= +1; = +1;
/* establish translatable header 'column' requirements /* establish translatable header 'column' requirements
and ensure .width reflects the widest value */ and ensure .width reflects the widest value */
@ -2526,9 +2529,14 @@ static void zap_fieldstab (void) {
= Rc.fixed_widest ? 8 + Rc.fixed_widest : 8; = Rc.fixed_widest ? 8 + Rc.fixed_widest : 8;
Fieldstab[EU_WCH].width Fieldstab[EU_WCH].width
= Rc.fixed_widest ? 10 + Rc.fixed_widest : 10; = Rc.fixed_widest ? 10 + Rc.fixed_widest : 10;
// the initial namespace fields
for (i = EU_NS1; i <= EU_NS6; i++) for (i = EU_NS1; i <= EU_NS6; i++)
Fieldstab[i].width Fieldstab[i].width
= Rc.fixed_widest ? 10 + Rc.fixed_widest : 10; = Rc.fixed_widest ? 10 + Rc.fixed_widest : 10;
// the later namespace additions
for (i = EU_NS7; i <= EU_NS8; i++)
Fieldstab[i].width
= Rc.fixed_widest ? 10 + Rc.fixed_widest : 10;
} }
#endif #endif
@ -6465,6 +6473,8 @@ static const char *task_show (const WIN_t *q, int idx) {
case EU_NS4: // PIDS_NS_PID case EU_NS4: // PIDS_NS_PID
case EU_NS5: // PIDS_NS_USER case EU_NS5: // PIDS_NS_USER
case EU_NS6: // PIDS_NS_UTS case EU_NS6: // PIDS_NS_UTS
case EU_NS7: // PIDS_NS_CGROUP
case EU_NS8: // PIDS_NS_TIME
cp = make_num(rSv(i, ul_int), W, Jn, i, 1); cp = make_num(rSv(i, ul_int), W, Jn, i, 1);
break; break;
/* ul_int, scale_mem */ /* ul_int, scale_mem */

View File

@ -213,6 +213,7 @@ enum pflag {
EU_IRB, EU_IRO, EU_IWB, EU_IWO, EU_IRB, EU_IRO, EU_IWB, EU_IWO,
EU_AGI, EU_AGN, EU_AGI, EU_AGN,
EU_TM3, EU_TM4, EU_CUU, EU_CUC, EU_TM3, EU_TM4, EU_CUU, EU_CUC,
EU_NS7, EU_NS8,
#ifdef USE_X_COLHDR #ifdef USE_X_COLHDR
// not really pflags, used with tbl indexing // not really pflags, used with tbl indexing
EU_MAXPFLGS EU_MAXPFLGS

View File

@ -120,7 +120,7 @@ static void build_two_nlstabs (void) {
. using the 'X' command. That means the default width might produce . using the 'X' command. That means the default width might produce
. truncation but need not if widened (see the man page 'X' command). . truncation but need not if widened (see the man page 'X' command).
. .
. All headers are subject to a maximum of 7 on the Fields Management . All headers are subject to a maximum of 8 on the Fields Management
. screen where truncation is entirely acceptable. . screen where truncation is entirely acceptable.
. .
. The associated descriptions are always limited to 20 characters, . The associated descriptions are always limited to 20 characters,
@ -362,6 +362,12 @@ static void build_two_nlstabs (void) {
/* Translation Hint: maximum '%CUC' = 7 */ /* Translation Hint: maximum '%CUC' = 7 */
Head_nlstab[EU_CUC] = _("%CUC"); Head_nlstab[EU_CUC] = _("%CUC");
Desc_nlstab[EU_CUC] = _("Utilization + child"); Desc_nlstab[EU_CUC] = _("Utilization + child");
/* Translation Hint: maximum 'nsCGROUP' = 10 + */
Head_nlstab[EU_NS7] = _("nsCGROUP");
Desc_nlstab[EU_NS7] = _("CGRP namespace Inode");
/* Translation Hint: maximum 'nsTIME' = 10 + */
Head_nlstab[EU_NS8] = _("nsTIME");
Desc_nlstab[EU_NS8] = _("TIME namespace Inode");
} }