From 2a3997e2f0c6a9d4833e1505132c79714e656689 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 9 Mar 2021 00:00:00 -0600 Subject: [PATCH] misc: needed adaptations for the changes in api That snowball, which began as a simple removal of some brackets, now ends with this third patch restoring the ability to build our project. It was made necessary by the renaming (and rearranging) of several enumerators. Signed-off-by: Jim Warner --- pmap.c | 2 +- ps/common.h | 10 +++++----- ps/global.c | 10 +++++----- ps/output.c | 40 ++++++++++++++++++++-------------------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/pmap.c b/pmap.c index 42144971..ff289477 100644 --- a/pmap.c +++ b/pmap.c @@ -43,7 +43,7 @@ static struct pids_info *Pids_info; enum pids_item Pid_items[] = { PIDS_ID_PID, PIDS_ID_TGID, - PIDS_CMDLINE, PIDS_ADDR_START_STACK }; + PIDS_CMDLINE, PIDS_ADDR_STACK_START }; enum rel_items { pid, tgid, cmdline, start_stack }; const char *nls_Address, diff --git a/ps/common.h b/ps/common.h index 08af46a2..d0abca36 100644 --- a/ps/common.h +++ b/ps/common.h @@ -68,11 +68,11 @@ extern int Pids_index; // most of these need not be extern, they're unique to output.c // (but for future flexibility the easiest path has been taken) -makEXT(ADDR_END_CODE) -makEXT(ADDR_KSTK_EIP) -makEXT(ADDR_KSTK_ESP) -makEXT(ADDR_START_CODE) -makEXT(ADDR_START_STACK) +makEXT(ADDR_CODE_END) +makEXT(ADDR_CODE_START) +makEXT(ADDR_CURR_EIP) +makEXT(ADDR_CURR_ESP) +makEXT(ADDR_STACK_START) makEXT(CGNAME) makEXT(CGROUP) makEXT(CMD) diff --git a/ps/global.c b/ps/global.c index 72d32a42..601aff3c 100644 --- a/ps/global.c +++ b/ps/global.c @@ -54,11 +54,11 @@ int Pids_index; // actual number of active enums // most of these could be defined as static in the output.c module // (but for future flexibility, the easiest route has been chosen) -makREL(ADDR_END_CODE) -makREL(ADDR_KSTK_EIP) -makREL(ADDR_KSTK_ESP) -makREL(ADDR_START_CODE) -makREL(ADDR_START_STACK) +makREL(ADDR_CODE_END) +makREL(ADDR_CODE_START) +makREL(ADDR_CURR_EIP) +makREL(ADDR_CURR_ESP) +makREL(ADDR_STACK_START) makREL(ALARM) makREL(CGNAME) makREL(CGROUP) diff --git a/ps/output.c b/ps/output.c index e7f3a2ce..1c6351e1 100644 --- a/ps/output.c +++ b/ps/output.c @@ -873,18 +873,18 @@ tsiz text size (in Kbytes) ***/ static int pr_stackp(char *restrict const outbuf, const proc_t *restrict const pp){ -setREL1(ADDR_START_STACK) - return snprintf(outbuf, COLWID, "%0*lx", (int)(2*sizeof(long)), rSv(ADDR_START_STACK, ul_int, pp)); +setREL1(ADDR_STACK_START) + return snprintf(outbuf, COLWID, "%0*lx", (int)(2*sizeof(long)), rSv(ADDR_STACK_START, ul_int, pp)); } static int pr_esp(char *restrict const outbuf, const proc_t *restrict const pp){ -setREL1(ADDR_KSTK_ESP) - return snprintf(outbuf, COLWID, "%0*lx", (int)(2*sizeof(long)), rSv(ADDR_KSTK_ESP, ul_int, pp)); +setREL1(ADDR_CURR_ESP) + return snprintf(outbuf, COLWID, "%0*lx", (int)(2*sizeof(long)), rSv(ADDR_CURR_ESP, ul_int, pp)); } static int pr_eip(char *restrict const outbuf, const proc_t *restrict const pp){ -setREL1(ADDR_KSTK_EIP) - return snprintf(outbuf, COLWID, "%0*lx", (int)(2*sizeof(long)), rSv(ADDR_KSTK_EIP, ul_int, pp)); +setREL1(ADDR_CURR_EIP) + return snprintf(outbuf, COLWID, "%0*lx", (int)(2*sizeof(long)), rSv(ADDR_CURR_EIP, ul_int, pp)); } static int pr_bsdtime(char *restrict const outbuf, const proc_t *restrict const pp){ @@ -934,36 +934,36 @@ setREL1(VM_SIZE) /* kB data size. See drs, tsiz & trs. */ static int pr_dsiz(char *restrict const outbuf, const proc_t *restrict const pp){ long dsiz; -setREL3(VSIZE_PGS,ADDR_END_CODE,ADDR_START_CODE) +setREL3(VSIZE_PGS,ADDR_CODE_END,ADDR_CODE_START) dsiz = 0; - if(rSv(VSIZE_PGS, ul_int, pp)) dsiz += (rSv(VSIZE_PGS, ul_int, pp) - rSv(ADDR_END_CODE, ul_int, pp) + rSv(ADDR_START_CODE, ul_int, pp)) >> 10; + if(rSv(VSIZE_PGS, ul_int, pp)) dsiz += (rSv(VSIZE_PGS, ul_int, pp) - rSv(ADDR_CODE_END, ul_int, pp) + rSv(ADDR_CODE_START, ul_int, pp)) >> 10; return snprintf(outbuf, COLWID, "%ld", dsiz); } /* kB text (code) size. See trs, dsiz & drs. */ static int pr_tsiz(char *restrict const outbuf, const proc_t *restrict const pp){ long tsiz; -setREL3(VSIZE_PGS,ADDR_END_CODE,ADDR_START_CODE) +setREL3(VSIZE_PGS,ADDR_CODE_END,ADDR_CODE_START) tsiz = 0; - if(rSv(VSIZE_PGS, ul_int, pp)) tsiz += (rSv(ADDR_END_CODE, ul_int, pp) - rSv(ADDR_START_CODE, ul_int, pp)) >> 10; + if(rSv(VSIZE_PGS, ul_int, pp)) tsiz += (rSv(ADDR_CODE_END, ul_int, pp) - rSv(ADDR_CODE_START, ul_int, pp)) >> 10; return snprintf(outbuf, COLWID, "%ld", tsiz); } /* kB _resident_ data size. See dsiz, tsiz & trs. */ static int pr_drs(char *restrict const outbuf, const proc_t *restrict const pp){ long drs; -setREL3(VSIZE_PGS,ADDR_END_CODE,ADDR_START_CODE) +setREL3(VSIZE_PGS,ADDR_CODE_END,ADDR_CODE_START) drs = 0; - if(rSv(VSIZE_PGS, ul_int, pp)) drs += (rSv(VSIZE_PGS, ul_int, pp) - rSv(ADDR_END_CODE, ul_int, pp) + rSv(ADDR_START_CODE, ul_int, pp)) >> 10; + if(rSv(VSIZE_PGS, ul_int, pp)) drs += (rSv(VSIZE_PGS, ul_int, pp) - rSv(ADDR_CODE_END, ul_int, pp) + rSv(ADDR_CODE_START, ul_int, pp)) >> 10; return snprintf(outbuf, COLWID, "%ld", drs); } /* kB text _resident_ (code) size. See tsiz, dsiz & drs. */ static int pr_trs(char *restrict const outbuf, const proc_t *restrict const pp){ long trs; -setREL3(VSIZE_PGS,ADDR_END_CODE,ADDR_START_CODE) +setREL3(VSIZE_PGS,ADDR_CODE_END,ADDR_CODE_START) trs = 0; - if(rSv(VSIZE_PGS, ul_int, pp)) trs += (rSv(ADDR_END_CODE, ul_int, pp) - rSv(ADDR_START_CODE, ul_int, pp)) >> 10; + if(rSv(VSIZE_PGS, ul_int, pp)) trs += (rSv(ADDR_CODE_END, ul_int, pp) - rSv(ADDR_CODE_START, ul_int, pp)) >> 10; return snprintf(outbuf, COLWID, "%ld", trs); } @@ -1570,11 +1570,11 @@ static const format_struct format_array[] = { /* {"dsiz", "DSIZ", pr_dsiz, PIDS_VSIZE_PGS, 4, LNX, PO|RIGHT}, {"egid", "EGID", pr_egid, PIDS_ID_EGID, 5, LNX, ET|RIGHT}, {"egroup", "EGROUP", pr_egroup, PIDS_ID_EGROUP, 8, LNX, ET|USER}, -{"eip", "EIP", pr_eip, PIDS_ADDR_KSTK_EIP, (int)(2*sizeof(long)), LNX, TO|RIGHT}, +{"eip", "EIP", pr_eip, PIDS_ADDR_CURR_EIP, (int)(2*sizeof(long)), LNX, TO|RIGHT}, {"emul", "EMUL", pr_nop, PIDS_noop, 13, BSD, PO|LEFT}, /* "FreeBSD ELF32" and such */ -{"end_code", "E_CODE", pr_nop, PIDS_ADDR_END_CODE, (int)(2*sizeof(long)), LNx, PO|RIGHT}, // sortable, but unprintable ?? +{"end_code", "E_CODE", pr_nop, PIDS_ADDR_CODE_END, (int)(2*sizeof(long)), LNx, PO|RIGHT}, // sortable, but unprintable ?? {"environ","ENVIRONMENT",pr_nop, PIDS_noop, 11, LNx, PO|UNLIMITED}, -{"esp", "ESP", pr_esp, PIDS_ADDR_KSTK_ESP, (int)(2*sizeof(long)), LNX, TO|RIGHT}, +{"esp", "ESP", pr_esp, PIDS_ADDR_CURR_ESP, (int)(2*sizeof(long)), LNX, TO|RIGHT}, {"etime", "ELAPSED", pr_etime, PIDS_TIME_ELAPSED, 11, U98, ET|RIGHT}, /* was 7 wide */ {"etimes", "ELAPSED", pr_etimes, PIDS_TIME_ELAPSED, 7, BSD, ET|RIGHT}, /* FreeBSD */ {"euid", "EUID", pr_euid, PIDS_ID_EUID, 5, LNX, ET|RIGHT}, @@ -1712,10 +1712,10 @@ static const format_struct format_array[] = { /* {"sl", "SL", pr_nop, PIDS_noop, 3, XXX, AN|RIGHT}, {"slice", "SLICE", pr_sd_slice, PIDS_SD_SLICE, 31, LNX, ET|LEFT}, {"spid", "SPID", pr_tasks, PIDS_ID_PID, 5, SGI, TO|PIDMAX|RIGHT}, -{"stackp", "STACKP", pr_stackp, PIDS_ADDR_START_STACK, (int)(2*sizeof(long)), LNX, PO|RIGHT}, /*start_stack*/ +{"stackp", "STACKP", pr_stackp, PIDS_ADDR_STACK_START, (int)(2*sizeof(long)), LNX, PO|RIGHT}, /*start_stack*/ {"start", "STARTED", pr_start, PIDS_TIME_START, 8, XXX, ET|RIGHT}, -{"start_code", "S_CODE", pr_nop, PIDS_ADDR_START_CODE, (int)(2*sizeof(long)), LNx, PO|RIGHT}, // sortable, but unprintable ?? -{"start_stack", "STACKP",pr_stackp, PIDS_ADDR_START_STACK, (int)(2*sizeof(long)), LNX, PO|RIGHT}, /*stackp*/ +{"start_code", "S_CODE", pr_nop, PIDS_ADDR_CODE_START, (int)(2*sizeof(long)), LNx, PO|RIGHT}, // sortable, but unprintable ?? +{"start_stack", "STACKP",pr_stackp, PIDS_ADDR_STACK_START, (int)(2*sizeof(long)), LNX, PO|RIGHT}, /*stackp*/ {"start_time", "START", pr_stime, PIDS_TIME_START, 5, LNx, ET|RIGHT}, {"stat", "STAT", pr_stat, PIDS_STATE, 4, BSD, TO|LEFT}, /*state,s*/ {"state", "S", pr_s, PIDS_STATE, 1, XXX, TO|LEFT}, /*stat,s*/ /* was STAT */