ps: added 2 new fields for displaying autogroup values

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2021-08-06 00:00:00 -05:00 committed by Craig Small
parent 70566acf34
commit c5d1bdd083
3 changed files with 16 additions and 0 deletions

View File

@ -73,6 +73,8 @@ makEXT(ADDR_CODE_START)
makEXT(ADDR_CURR_EIP)
makEXT(ADDR_CURR_ESP)
makEXT(ADDR_STACK_START)
makEXT(AUTOGRP_ID)
makEXT(AUTOGRP_NICE)
makEXT(CGNAME)
makEXT(CGROUP)
makEXT(CMD)

View File

@ -59,6 +59,8 @@ makREL(ADDR_CODE_START)
makREL(ADDR_CURR_EIP)
makREL(ADDR_CURR_ESP)
makREL(ADDR_STACK_START)
makREL(AUTOGRP_ID)
makREL(AUTOGRP_NICE)
makREL(CGNAME)
makREL(CGROUP)
makREL(CMD)

View File

@ -1464,6 +1464,16 @@ setREL1(ID_TGID)
return len;
}
/************************ Linux autogroups ******************************/
static int pr_agid(char *restrict const outbuf, const proc_t *restrict const pp){
setREL1(AUTOGRP_ID)
return snprintf(outbuf, COLWID, "%d", rSv(AUTOGRP_ID, s_int, pp));
}
static int pr_agnice(char *restrict const outbuf, const proc_t *restrict const pp){
setREL1(AUTOGRP_NICE)
return snprintf(outbuf, COLWID, "%d", rSv(AUTOGRP_NICE, s_int, pp));
}
////////////////////////////// Test code /////////////////////////////////
// like "args"
@ -1578,6 +1588,8 @@ static const format_struct format_array[] = { /*
{"acflg", "ACFLG", pr_nop, PIDS_noop, 5, BSD, AN|RIGHT}, /*acflag*/
{"addr", "ADDR", pr_nop, PIDS_noop, 4, XXX, AN|RIGHT},
{"addr_1", "ADDR", pr_nop, PIDS_noop, 1, LNX, AN|LEFT},
{"ag_id", "AGID", pr_agid, PIDS_AUTOGRP_ID, 5, LNX, AN|RIGHT},
{"ag_nice", "AGNI", pr_agnice, PIDS_AUTOGRP_NICE, 4, LNX, AN|RIGHT},
{"alarm", "ALARM", pr_nop, PIDS_noop, 5, LNX, AN|RIGHT},
{"argc", "ARGC", pr_nop, PIDS_noop, 4, LNX, PO|RIGHT},
{"args", "COMMAND", pr_args, PIDS_CMDLINE, 27, U98, PO|UNLIMITED}, /*command*/