top: revise default for forest view child scans

In an effort to avoid dangling children when in forest
view mode, top defaulted to a complete rescan of every
proc_t for each child encountered.

That expense was never really cost justified and now
with the 3.3 kernel 'hidepid' provisions it no longer
can offer such protection.

With this commit, the TREE_ONEPASS define is changed
to TREE_RESCANS so as to reverse the default scan
behavior.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2012-07-04 04:04:04 -05:00 committed by Craig Small
parent 06e92e93b8
commit a2086dfdf6
2 changed files with 5 additions and 5 deletions

View File

@ -3392,11 +3392,11 @@ static void forest_add (const int self, const int level) {
Tree_ppt[Tree_idx] = Seed_ppt[self]; // add this as root or child
Tree_ppt[Tree_idx++]->pad_3 = level; // borrow 1 byte, 127 levels
#ifdef TREE_ONEPASS
for (i = self + 1; i < Frame_maxtask; i++) {
#ifdef TREE_RESCANS
for (i = 0; i < Frame_maxtask; i++) { // this is hardly bullet proof now,
if (i == self) continue; // with 3.3 proc hidepid provisions
#else
for (i = 0; i < Frame_maxtask; i++) {
if (i == self) continue;
for (i = self + 1; i < Frame_maxtask; i++) {
#endif
if (Seed_ppt[self]->tid == Seed_ppt[i]->tgid
|| (Seed_ppt[self]->tid == Seed_ppt[i]->ppid && Seed_ppt[i]->tid == Seed_ppt[i]->tgid))

View File

@ -43,7 +43,7 @@
//#define STRINGCASENO /* case insenstive compare/locate versions */
//#define TERMIO_PROXY /* true line editing, beyond native input */
//#define TREE_NORESET /* sort keys do NOT force forest view OFF */
//#define TREE_ONEPASS /* for speed, tolerate dangling children */
//#define TREE_RESCANS /* restart scan to avoid dangling children */
//#define USE_X_COLHDR /* emphasize header vs. whole col, for 'x' */
//#define VALIDATE_NLS /* validate integrity of all 3 nls tables */
//#define WARN_CFG_OFF /* warning OFF when overwriting old rcfile */