library: some miscellaneous tweaks before smaps_rollup

This commit is strictly cosmetic. It was an attempt to
normalize/standardize/alphabetize those #define/#undef
statements. Some missing #undef's were added plus some
comments regarding sources corrected/standardized too.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2021-04-26 00:00:00 -05:00 committed by Craig Small
parent 4153e72921
commit b921776dad
2 changed files with 17 additions and 14 deletions

View File

@ -346,9 +346,9 @@ srtDECL(noop) {
#define f_either PROC_SPARE_1 // either status or stat (favor stat)
#define f_exe PROC_FILL_EXE
#define f_grp PROC_FILLGRP
#define f_io PROC_FILLIO
#define f_login PROC_FILL_LUID
#define f_lxc PROC_FILL_LXC
#define f_io PROC_FILLIO
#define f_ns PROC_FILLNS
#define f_oom PROC_FILLOOM
#define f_stat PROC_FILLSTAT
@ -356,14 +356,14 @@ srtDECL(noop) {
#define f_status PROC_FILLSTATUS
#define f_systemd PROC_FILLSYSTEMD
#define f_usr PROC_FILLUSR
// these next three will yield a single string (never vectorized)
#define x_cgroup PROC_EDITCGRPCVT
#define x_cmdline PROC_EDITCMDLCVT
#define x_environ PROC_EDITENVRCVT
// these next three will yield true verctorized strings
#define v_arg PROC_FILLARG
#define v_cgroup PROC_FILLCGROUP
#define v_env PROC_FILLENV
// these next three will yield a single string (never vectorized)
#define x_cgroup PROC_EDITCGRPCVT
#define x_cmdline PROC_EDITCMDLCVT
#define x_environ PROC_EDITENVRCVT
// these next three will also force PROC_FILLSTATUS
#define x_ogroup PROC_FILL_OGROUPS
#define x_ouser PROC_FILL_OUSERS
@ -544,7 +544,10 @@ enum pids_item PIDS_logical_end = MAXTABLE(Item_table);
#undef QS
//#undef f_either // needed later
#undef f_exe
#undef f_grp
#undef f_io
#undef f_login
#undef f_lxc
#undef f_ns
#undef f_oom

View File

@ -1164,12 +1164,12 @@ static proc_t* simple_readtask(PROCTAB *restrict const PT, proc_t *restrict cons
rc += stat2proc(ub.buf, t);
}
if (flags & PROC_FILLIO) { // read /proc/#/io
if (flags & PROC_FILLIO) { // read /proc/#/task/#/io
if (file2str(path, "io", &ub) != -1)
io2proc(ub.buf, t);
}
if (flags & PROC_FILLMEM) { // read /proc/#/task/#statm
if (flags & PROC_FILLMEM) { // read /proc/#/task/#/statm
if (file2str(path, "statm", &ub) != -1)
statm2proc(ub.buf, t);
}