library: improve internal 'get' processing, <STAT> api
With an eye to the future, rather than managing a long
switch/case construct in the procps_stat_get function,
we'll adopt the approach used in the <meminfo> module.
By making 'get' processing table driven too, just like
'select' is already, that may ease future maintenance.
Along the way a rather large boo-boo was fixed dealing
with that /proc/stat 'procs_running' field which crept
in with the commit referenced below. It wasn't spelled
correctly and thus was never captured as PROC_RUNNING.
Reference(s):
commit abc71a46ad
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@@ -37,6 +37,7 @@ enum stat_item {
|
||||
PROCPS_STAT_TIC_STOLEN, // ull_int
|
||||
PROCPS_STAT_TIC_GUEST, // ull_int
|
||||
PROCPS_STAT_TIC_GUEST_NICE, // ull_int
|
||||
|
||||
PROCPS_STAT_TIC_DELTA_USER, // sl_int
|
||||
PROCPS_STAT_TIC_DELTA_NICE, // sl_int
|
||||
PROCPS_STAT_TIC_DELTA_SYSTEM, // sl_int
|
||||
@@ -54,6 +55,7 @@ enum stat_item {
|
||||
PROCPS_STAT_SYS_PROC_CREATED, // ul_int
|
||||
PROCPS_STAT_SYS_PROC_RUNNING, // ul_int
|
||||
PROCPS_STAT_SYS_TIME_OF_BOOT, // ul_int
|
||||
|
||||
PROCPS_STAT_SYS_DELTA_CTX_SWITCHES, // s_int
|
||||
PROCPS_STAT_SYS_DELTA_INTERRUPTS, // s_int
|
||||
PROCPS_STAT_SYS_DELTA_PROC_BLOCKED, // s_int
|
||||
|
||||
Reference in New Issue
Block a user