]> granicus.if.org Git - procps-ng/commitdiff
library: extend 'noop' concept to a resettable 'extra'
authorJim Warner <james.warner@comcast.net>
Thu, 3 Sep 2015 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Sun, 6 Sep 2015 11:57:49 +0000 (21:57 +1000)
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>
proc/pids.h

index 35e3d1b870f981bb3af7b0744d0cc60ee4320bb9..68d9ddcd0a337eebf96c4ee12debeb5c8d77b8b6 100644 (file)
@@ -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 {