Parent tasks with collapsed children should have their
cpu reflect any unseen tasks only under the following:
1) When built without TREE_VCPUOFF having been defined
2) Exclusively when 'Show_FOREST' display mode was set
3) And only under the current window when in alternate
display mode (except if TREE_VWINALL has been defined)
So, this commit just ensures these objectives are met.
Reference(s):
. issue that began odyssey
https://gitlab.com/procps-ng/procps/issues/99
. original cpu implementation
commit
7c7903e50dff8719408b2a95d75f94ec1407aff7
Signed-off-by: Jim Warner <james.warner@comcast.net>
{ float u = (float)rSv(EU_CPU, s_int);
int n = rSv(EU_THD, s_int);
#ifndef TREE_VCPUOFF
- // this eu_TREE_ADD is always zero, unless we're a collapsed parent
- u += rSv(eu_TREE_ADD, u_int);
+ #ifndef TREE_VWINALL
+ if (q == Curwin) // note: the following is NOT indented
+ #endif
+ if (CHKw(q, Show_FOREST)) u += rSv(eu_TREE_ADD, u_int);
u *= Frame_etscale;
if (rSv(eu_TREE_HID, s_ch) != 'x' && u > 100.0 * n) u = 100.0 * n;
#else