top: utilize a library result struct for 'forest view'

When top was originally adapted to use that <pids> API,
the forest view support was redesigned since the proc_t
pad_3 byte could no longer be employed to hold a task's
nesting level. The redesign required additional arrays.

Now that the dust is settling on those initial efforts,
that PROCPS_PIDS_noop item was used as a substitute for
the old pad_3 along with a return to the former design.
But, while it proved adequate, the invariant nature for
that item required of top an extra initialization step.

So the library was coaxed into adding one more pid_item
(PROCPS_PIDS_extra) which will, unlike that 'noop' guy,
be reset with each reap. Everybody should be happy now.

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 07ec0b4e09
commit bb04019510
2 changed files with 35 additions and 36 deletions

View File

@@ -684,12 +684,12 @@ typedef struct WIN_t {
/*------ Forest View support -------------------------------------------*/
//atic void forest_begin (const int self, int level);
//atic void forest_create (WIN_t *q);
//atic inline const char *forest_display (const WIN_t *q, const int idx);
//atic inline const char *forest_display (const WIN_t *q, struct pids_stack *p);
/*------ Main Screen routines ------------------------------------------*/
//atic void do_key (int ch);
//atic void summary_hlp (struct procps_jiffs_hist *cpu, const char *pfx);
//atic void summary_show (void);
//atic const char *task_show (const WIN_t *q, const int idx);
//atic const char *task_show (const WIN_t *q, struct pids_stack *p);
//atic int window_show (WIN_t *q, int wmax);
/*------ Entry point plus two ------------------------------------------*/
//atic void frame_hlp (int wix, int max);