#define setDECL(e) static void setNAME(e) \
(struct procps_pidsinfo *I, struct pids_result *R, proc_t *P)
- // value the addr member
-#define ADR_set(e,t,x) setDECL(e) { \
- (void)I; R->result. t = (void *)P-> x; }
// convert pages to kib
#define CVT_set(e,t,x) setDECL(e) { \
R->result. t = (unsigned long)(P-> x) << I -> pgs2k_shift; }
#define VEC_set(e,x) setDECL(e) { \
(void)I; R->result.strv = P-> x; P-> x = NULL; }
-ADR_set(ADDR_END_CODE, addr, end_code)
-ADR_set(ADDR_KSTK_EIP, addr, kstk_eip)
-ADR_set(ADDR_KSTK_ESP, addr, kstk_esp)
-ADR_set(ADDR_START_CODE, addr, start_code)
-ADR_set(ADDR_START_STACK, addr, start_stack)
+REG_set(ADDR_END_CODE, ul_int, end_code)
+REG_set(ADDR_KSTK_EIP, ul_int, kstk_eip)
+REG_set(ADDR_KSTK_ESP, ul_int, kstk_esp)
+REG_set(ADDR_START_CODE, ul_int, start_code)
+REG_set(ADDR_START_STACK, ul_int, start_stack)
REG_set(ALARM, sl_int, alarm)
STV_set(CGROUP, cgroup)
VEC_set(CGROUP_V, cgroup)
REG_set(VM_SWAP, ul_int, vm_swap)
setDECL(VM_USED) { (void)I; R->result.ul_int = P->vm_swap + P->vm_rss; }
REG_set(VSIZE_PGS, ul_int, vsize)
-ADR_set(WCHAN_ADDR, addr, wchan)
+REG_set(WCHAN_ADDR, ul_int, wchan)
setDECL(WCHAN_NAME) { (void)I; R->result.str = strdup(lookup_wchan(P->tid)); }
setDECL(xtra) { (void)I; (void)R; (void)P; return; }
setDECL(noop) { (void)I; (void)R; (void)P; return; }
setDECL(physical_end) { (void)I; (void)R; (void)P; return; }
#undef setDECL
-#undef ADR_set
#undef CVT_set
#undef DUP_set
#undef REG_set
REG_srt(u_int)
REG_srt(ul_int)
REG_srt(ull_int)
-REG_srt(addr)
static int srtNAME(str) (
const struct pids_stack **A, const struct pids_stack **B, struct sort_parms *P) {
} Item_table[] = {
/* setsfunc oldflags freefunc sortfunc needhist
--------------------- ---------- --------- ------------ -------- */
- { RS(ADDR_END_CODE), f_stat, NULL, QS(addr), 0 },
- { RS(ADDR_KSTK_EIP), f_stat, NULL, QS(addr), 0 },
- { RS(ADDR_KSTK_ESP), f_stat, NULL, QS(addr), 0 },
- { RS(ADDR_START_CODE), f_stat, NULL, QS(addr), 0 },
- { RS(ADDR_START_STACK), f_stat, NULL, QS(addr), 0 },
+ { RS(ADDR_END_CODE), f_stat, NULL, QS(ul_int), 0 },
+ { RS(ADDR_KSTK_EIP), f_stat, NULL, QS(ul_int), 0 },
+ { RS(ADDR_KSTK_ESP), f_stat, NULL, QS(ul_int), 0 },
+ { RS(ADDR_START_CODE), f_stat, NULL, QS(ul_int), 0 },
+ { RS(ADDR_START_STACK), f_stat, NULL, QS(ul_int), 0 },
{ RS(ALARM), f_stat, NULL, QS(sl_int), 0 },
{ RS(CGROUP), x_cgroup, FF(str), QS(str), 0 },
{ RS(CGROUP_V), v_cgroup, FF(strv), QS(strv), 0 },
{ RS(VM_SWAP), f_status, NULL, QS(ul_int), 0 },
{ RS(VM_USED), f_status, NULL, QS(ul_int), 0 },
{ RS(VSIZE_PGS), f_stat, NULL, QS(ul_int), 0 },
- { RS(WCHAN_ADDR), f_stat, NULL, QS(addr), 0 },
+ { RS(WCHAN_ADDR), f_stat, NULL, QS(ul_int), 0 },
{ RS(WCHAN_NAME), 0, FF(str), QS(str), 0 },
{ RS(xtra), 0, NULL, QS(noop), 0 },
{ RS(noop), 0, NULL, QS(noop), 0 },
__BEGIN_DECLS
enum pids_item {
- PROCPS_PIDS_ADDR_END_CODE, // addr
- PROCPS_PIDS_ADDR_KSTK_EIP, // addr
- PROCPS_PIDS_ADDR_KSTK_ESP, // addr
- PROCPS_PIDS_ADDR_START_CODE, // addr
- PROCPS_PIDS_ADDR_START_STACK, // addr
+ PROCPS_PIDS_ADDR_END_CODE, // ul_int
+ PROCPS_PIDS_ADDR_KSTK_EIP, // ul_int
+ PROCPS_PIDS_ADDR_KSTK_ESP, // ul_int
+ PROCPS_PIDS_ADDR_START_CODE, // ul_int
+ PROCPS_PIDS_ADDR_START_STACK, // ul_int
PROCPS_PIDS_ALARM, // sl_int
PROCPS_PIDS_CGROUP, // str
PROCPS_PIDS_CGROUP_V, // strv
PROCPS_PIDS_VM_SWAP, // ul_int
PROCPS_PIDS_VM_USED, // ul_int
PROCPS_PIDS_VSIZE_PGS, // ul_int
- PROCPS_PIDS_WCHAN_ADDR, // addr
+ PROCPS_PIDS_WCHAN_ADDR, // ul_int
PROCPS_PIDS_WCHAN_NAME, // str
PROCPS_PIDS_extra, // ( reset to zero )
PROCPS_PIDS_noop // ( never altered )
long sl_int;
unsigned long ul_int;
unsigned long long ull_int;
- void * addr;
char * str;
char ** strv;
} result;