library: improve header file item comments, <STAT> api
This patch just polishes the 'origin' comments for the <STAT> header file. In particular those derived/unique items (the 'SUM' guys) will now be properly explained. [ in order to employ the 'derived from above' phrase ] [ with their DELTA versions, all SUM items had to be ] [ relocated (and some renamed). in turn, that had an ] [ impact on many portions of the .c source file too. ] Reference(s): . summary calculations introduced commit2c86c4984a
. origins added to header files commit96d59cbf46
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
68d7f7a673
commit
201e816b26
48
proc/stat.c
48
proc/stat.c
@ -163,12 +163,6 @@ TIC_set(TIC_STOLEN, ull_int, stolen)
|
|||||||
TIC_set(TIC_GUEST, ull_int, guest)
|
TIC_set(TIC_GUEST, ull_int, guest)
|
||||||
TIC_set(TIC_GUEST_NICE, ull_int, gnice)
|
TIC_set(TIC_GUEST_NICE, ull_int, gnice)
|
||||||
|
|
||||||
TIC_set(TIC_SUM_TOTAL, ull_int, xtot)
|
|
||||||
TIC_set(TIC_SUM_BUSY, ull_int, xbsy)
|
|
||||||
TIC_set(TIC_SUM_IDLE, ull_int, xidl)
|
|
||||||
TIC_set(TIC_SUM_USER, ull_int, xusr)
|
|
||||||
TIC_set(TIC_SUM_SYSTEM, ull_int, xsys)
|
|
||||||
|
|
||||||
TICsetH(TIC_DELTA_USER, sl_int, user)
|
TICsetH(TIC_DELTA_USER, sl_int, user)
|
||||||
TICsetH(TIC_DELTA_NICE, sl_int, nice)
|
TICsetH(TIC_DELTA_NICE, sl_int, nice)
|
||||||
TICsetH(TIC_DELTA_SYSTEM, sl_int, system)
|
TICsetH(TIC_DELTA_SYSTEM, sl_int, system)
|
||||||
@ -180,11 +174,17 @@ TICsetH(TIC_DELTA_STOLEN, sl_int, stolen)
|
|||||||
TICsetH(TIC_DELTA_GUEST, sl_int, guest)
|
TICsetH(TIC_DELTA_GUEST, sl_int, guest)
|
||||||
TICsetH(TIC_DELTA_GUEST_NICE, sl_int, gnice)
|
TICsetH(TIC_DELTA_GUEST_NICE, sl_int, gnice)
|
||||||
|
|
||||||
TICsetH(TIC_DELTA_SUM_TOTAL, sl_int, xtot)
|
TIC_set(TIC_SUM_TOTAL, ull_int, xtot)
|
||||||
TICsetH(TIC_DELTA_SUM_BUSY, sl_int, xbsy)
|
TIC_set(TIC_SUM_IDLE, ull_int, xidl)
|
||||||
TICsetH(TIC_DELTA_SUM_IDLE, sl_int, xidl)
|
TIC_set(TIC_SUM_USER, ull_int, xusr)
|
||||||
TICsetH(TIC_DELTA_SUM_USER, sl_int, xusr)
|
TIC_set(TIC_SUM_BUSY, ull_int, xbsy)
|
||||||
TICsetH(TIC_DELTA_SUM_SYSTEM, sl_int, xsys)
|
TIC_set(TIC_SUM_SYSTEM, ull_int, xsys)
|
||||||
|
|
||||||
|
TICsetH(TIC_SUM_DELTA_TOTAL, sl_int, xtot)
|
||||||
|
TICsetH(TIC_SUM_DELTA_IDLE, sl_int, xidl)
|
||||||
|
TICsetH(TIC_SUM_DELTA_USER, sl_int, xusr)
|
||||||
|
TICsetH(TIC_SUM_DELTA_BUSY, sl_int, xbsy)
|
||||||
|
TICsetH(TIC_SUM_DELTA_SYSTEM, sl_int, xsys)
|
||||||
|
|
||||||
SYS_set(SYS_CTX_SWITCHES, ul_int, ctxt)
|
SYS_set(SYS_CTX_SWITCHES, ul_int, ctxt)
|
||||||
SYS_set(SYS_INTERRUPTS, ul_int, intr)
|
SYS_set(SYS_INTERRUPTS, ul_int, intr)
|
||||||
@ -292,12 +292,6 @@ static struct {
|
|||||||
{ RS(TIC_GUEST), QS(ull_int), TS(ull_int) },
|
{ RS(TIC_GUEST), QS(ull_int), TS(ull_int) },
|
||||||
{ RS(TIC_GUEST_NICE), QS(ull_int), TS(ull_int) },
|
{ RS(TIC_GUEST_NICE), QS(ull_int), TS(ull_int) },
|
||||||
|
|
||||||
{ RS(TIC_SUM_TOTAL), QS(ull_int), TS(ull_int) },
|
|
||||||
{ RS(TIC_SUM_BUSY), QS(ull_int), TS(ull_int) },
|
|
||||||
{ RS(TIC_SUM_IDLE), QS(ull_int), TS(ull_int) },
|
|
||||||
{ RS(TIC_SUM_USER), QS(ull_int), TS(ull_int) },
|
|
||||||
{ RS(TIC_SUM_SYSTEM), QS(ull_int), TS(ull_int) },
|
|
||||||
|
|
||||||
{ RS(TIC_DELTA_USER), QS(sl_int), TS(sl_int) },
|
{ RS(TIC_DELTA_USER), QS(sl_int), TS(sl_int) },
|
||||||
{ RS(TIC_DELTA_NICE), QS(sl_int), TS(sl_int) },
|
{ RS(TIC_DELTA_NICE), QS(sl_int), TS(sl_int) },
|
||||||
{ RS(TIC_DELTA_SYSTEM), QS(sl_int), TS(sl_int) },
|
{ RS(TIC_DELTA_SYSTEM), QS(sl_int), TS(sl_int) },
|
||||||
@ -309,11 +303,17 @@ static struct {
|
|||||||
{ RS(TIC_DELTA_GUEST), QS(sl_int), TS(sl_int) },
|
{ RS(TIC_DELTA_GUEST), QS(sl_int), TS(sl_int) },
|
||||||
{ RS(TIC_DELTA_GUEST_NICE), QS(sl_int), TS(sl_int) },
|
{ RS(TIC_DELTA_GUEST_NICE), QS(sl_int), TS(sl_int) },
|
||||||
|
|
||||||
{ RS(TIC_DELTA_SUM_TOTAL), QS(sl_int), TS(sl_int) },
|
{ RS(TIC_SUM_TOTAL), QS(ull_int), TS(ull_int) },
|
||||||
{ RS(TIC_DELTA_SUM_BUSY), QS(sl_int), TS(sl_int) },
|
{ RS(TIC_SUM_IDLE), QS(ull_int), TS(ull_int) },
|
||||||
{ RS(TIC_DELTA_SUM_IDLE), QS(sl_int), TS(sl_int) },
|
{ RS(TIC_SUM_USER), QS(ull_int), TS(ull_int) },
|
||||||
{ RS(TIC_DELTA_SUM_USER), QS(sl_int), TS(sl_int) },
|
{ RS(TIC_SUM_BUSY), QS(ull_int), TS(ull_int) },
|
||||||
{ RS(TIC_DELTA_SUM_SYSTEM), QS(sl_int), TS(sl_int) },
|
{ RS(TIC_SUM_SYSTEM), QS(ull_int), TS(ull_int) },
|
||||||
|
|
||||||
|
{ RS(TIC_SUM_DELTA_TOTAL), QS(sl_int), TS(sl_int) },
|
||||||
|
{ RS(TIC_SUM_DELTA_IDLE), QS(sl_int), TS(sl_int) },
|
||||||
|
{ RS(TIC_SUM_DELTA_USER), QS(sl_int), TS(sl_int) },
|
||||||
|
{ RS(TIC_SUM_DELTA_BUSY), QS(sl_int), TS(sl_int) },
|
||||||
|
{ RS(TIC_SUM_DELTA_SYSTEM), QS(sl_int), TS(sl_int) },
|
||||||
|
|
||||||
{ RS(SYS_CTX_SWITCHES), QS(ul_int), TS(ul_int) },
|
{ RS(SYS_CTX_SWITCHES), QS(ul_int), TS(ul_int) },
|
||||||
{ RS(SYS_INTERRUPTS), QS(ul_int), TS(ul_int) },
|
{ RS(SYS_INTERRUPTS), QS(ul_int), TS(ul_int) },
|
||||||
@ -1060,8 +1060,8 @@ PROCPS_EXPORT struct stat_reaped *procps_stat_reap (
|
|||||||
break;
|
break;
|
||||||
case STAT_REAP_CPUS_AND_NODES:
|
case STAT_REAP_CPUS_AND_NODES:
|
||||||
/* note: if we're doing numa at all, we must do this numa history |
|
/* note: if we're doing numa at all, we must do this numa history |
|
||||||
before we build (fetch) the cpu stacks since the read_stat guy |
|
before we build (fetch) cpu stacks since that stat_read_failed |
|
||||||
will have marked (temporarily) all the cpu node ids as invalid | */
|
guy always marks (temporarily) all the cpu node ids as invalid | */
|
||||||
if (0 > stat_make_numa_hist(info))
|
if (0 > stat_make_numa_hist(info))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (0 > stat_stacks_fetch(info, &info->nodes))
|
if (0 > stat_stacks_fetch(info, &info->nodes))
|
||||||
|
25
proc/stat.h
25
proc/stat.h
@ -30,7 +30,8 @@ enum stat_item {
|
|||||||
// ------- -------------------
|
// ------- -------------------
|
||||||
STAT_TIC_ID, // s_int /proc/stat
|
STAT_TIC_ID, // s_int /proc/stat
|
||||||
STAT_TIC_NUMA_NODE, // s_int [ ID based, see: numa(3) ]
|
STAT_TIC_NUMA_NODE, // s_int [ ID based, see: numa(3) ]
|
||||||
STAT_TIC_NUM_CONTRIBUTORS, // s_int [ ID based, see: numa(3) ]
|
STAT_TIC_NUM_CONTRIBUTORS, // s_int [ total CPUs contributing to TIC counts ]
|
||||||
|
|
||||||
STAT_TIC_USER, // ull_int /proc/stat
|
STAT_TIC_USER, // ull_int /proc/stat
|
||||||
STAT_TIC_NICE, // ull_int "
|
STAT_TIC_NICE, // ull_int "
|
||||||
STAT_TIC_SYSTEM, // ull_int "
|
STAT_TIC_SYSTEM, // ull_int "
|
||||||
@ -42,12 +43,6 @@ enum stat_item {
|
|||||||
STAT_TIC_GUEST, // ull_int "
|
STAT_TIC_GUEST, // ull_int "
|
||||||
STAT_TIC_GUEST_NICE, // ull_int "
|
STAT_TIC_GUEST_NICE, // ull_int "
|
||||||
|
|
||||||
STAT_TIC_SUM_TOTAL, // ull_int "
|
|
||||||
STAT_TIC_SUM_BUSY, // ull_int "
|
|
||||||
STAT_TIC_SUM_IDLE, // ull_int "
|
|
||||||
STAT_TIC_SUM_USER, // ull_int "
|
|
||||||
STAT_TIC_SUM_SYSTEM, // ull_int "
|
|
||||||
|
|
||||||
STAT_TIC_DELTA_USER, // sl_int dervied from above
|
STAT_TIC_DELTA_USER, // sl_int dervied from above
|
||||||
STAT_TIC_DELTA_NICE, // sl_int "
|
STAT_TIC_DELTA_NICE, // sl_int "
|
||||||
STAT_TIC_DELTA_SYSTEM, // sl_int "
|
STAT_TIC_DELTA_SYSTEM, // sl_int "
|
||||||
@ -59,11 +54,17 @@ enum stat_item {
|
|||||||
STAT_TIC_DELTA_GUEST, // sl_int "
|
STAT_TIC_DELTA_GUEST, // sl_int "
|
||||||
STAT_TIC_DELTA_GUEST_NICE, // sl_int "
|
STAT_TIC_DELTA_GUEST_NICE, // sl_int "
|
||||||
|
|
||||||
STAT_TIC_DELTA_SUM_TOTAL, // sl_int "
|
STAT_TIC_SUM_TOTAL, // ull_int derived from all except GUEST tics
|
||||||
STAT_TIC_DELTA_SUM_BUSY, // sl_int "
|
STAT_TIC_SUM_IDLE, // ull_int derived from IDLE + IOWAIT + STOLEN tics
|
||||||
STAT_TIC_DELTA_SUM_IDLE, // sl_int "
|
STAT_TIC_SUM_USER, // ull_int derived from USER + NICE tics
|
||||||
STAT_TIC_DELTA_SUM_USER, // sl_int "
|
STAT_TIC_SUM_BUSY, // ull_int derived from SUM_TOTAL - SUM_IDLE tics
|
||||||
STAT_TIC_DELTA_SUM_SYSTEM, // sl_int "
|
STAT_TIC_SUM_SYSTEM, // ull_int derived from SUM_BUSY - SUM_USER tics
|
||||||
|
|
||||||
|
STAT_TIC_SUM_DELTA_TOTAL, // sl_int dervied from above
|
||||||
|
STAT_TIC_SUM_DELTA_IDLE, // sl_int "
|
||||||
|
STAT_TIC_SUM_DELTA_USER, // sl_int "
|
||||||
|
STAT_TIC_SUM_DELTA_BUSY, // sl_int "
|
||||||
|
STAT_TIC_SUM_DELTA_SYSTEM, // sl_int "
|
||||||
|
|
||||||
STAT_SYS_CTX_SWITCHES, // ul_int /proc/stat
|
STAT_SYS_CTX_SWITCHES, // ul_int /proc/stat
|
||||||
STAT_SYS_INTERRUPTS, // ul_int "
|
STAT_SYS_INTERRUPTS, // ul_int "
|
||||||
|
Loading…
Reference in New Issue
Block a user