From 07ec0b4e090e1740d451a5fb7c31bc853ac01db3 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Thu, 3 Sep 2015 00:00:00 -0500 Subject: [PATCH] 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 --- proc/pids.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proc/pids.h b/proc/pids.h index 35e3d1b8..68d9ddcd 100644 --- a/proc/pids.h +++ b/proc/pids.h @@ -134,7 +134,8 @@ enum pids_item { PROCPS_PIDS_VSIZE_PGS, // ul_int PROCPS_PIDS_WCHAN_ADDR, // addr 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 { -- 2.40.0