library: extend 'noop' concept to a resettable 'extra'

The presence of that PROCPS_PIDS_noop may yet see some
use in the future with its 'no alter' library promise.

However, when top used that item to reflect the forest
view nesting level, the unchanging nature of that item
became more of an inconvenience than benefit. For each
refresh top was forced to loop through all the stacks,
resetting that PROCPS_PIDS_noop result struct to zero.

So this commit will now offer users a choice between a
new re-initialized item (PROCPS_PIDS_extra) & the noop
invariant.  Since the library already resets all those
result structures, top will now utilize it at no cost.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2015-09-03 00:00:00 -05:00 committed by Craig Small
parent b2853ed117
commit 07ec0b4e09

View File

@ -134,7 +134,8 @@ enum pids_item {
PROCPS_PIDS_VSIZE_PGS, // ul_int PROCPS_PIDS_VSIZE_PGS, // ul_int
PROCPS_PIDS_WCHAN_ADDR, // addr PROCPS_PIDS_WCHAN_ADDR, // addr
PROCPS_PIDS_WCHAN_NAME, // str PROCPS_PIDS_WCHAN_NAME, // str
PROCPS_PIDS_noop // n/a PROCPS_PIDS_extra, // ( reset to zero )
PROCPS_PIDS_noop // ( never altered )
}; };
enum pids_fill_type { enum pids_fill_type {