top: introduced new focus toggle ('F'), program source
Sometimes, it might be useful to isolate a parent task and its forked children from other system activity. As an example, a user might want to examine workload in a specific lxc container. Or maybe there is some need to question what's happening under the same tmux session. Since forest view mode tends to be a relatively stable display, it will sometimes satisfy the above need. But that mode can't currently guarantee the target process always remains as the topmost task or even is visible. So, this patch will enable focusing on any parent task and keeping it as the topmost process while displaying it and its forked children only. It then appears as if there is no other activity in that system by virtue of the blank lines which follow that final child process. To implement this new feature, top's redundant 'F' key has been repurposed. It made little sense devoting two keys to the Fields Management screen (especially since the key we've taken required two separate keystrokes). [ and while we're at it, i also added punctuation to ] [ that prologue for 'forest_display' since all other ] [ forest functions used punctuation. And, instead of ] [ a pointer to a proc_t he will now get a ppt index. ] Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@@ -438,6 +438,9 @@ typedef struct WIN_t {
|
||||
int osel_tot; // total of other selection criteria
|
||||
char *findstr; // window's current/active search string
|
||||
int findlen; // above's strlen, without call overhead
|
||||
int focus_pid; // target pid when 'F' toggle is active
|
||||
int focus_beg; // ppt index where 'F' toggle has begun
|
||||
int focus_end; // ppt index where 'F' toggle has ended
|
||||
proc_t **ppt; // this window's proc_t ptr array
|
||||
struct WIN_t *next, // next window in window stack
|
||||
*prev; // prior window in window stack
|
||||
@@ -789,7 +792,8 @@ typedef struct WIN_t {
|
||||
//atic int forest_based (const proc_t **x, const proc_t **y);
|
||||
#endif
|
||||
//atic void forest_create (WIN_t *q);
|
||||
//atic inline const char *forest_display (const WIN_t *q, const proc_t *p);
|
||||
//atic inline const char *forest_display (const WIN_t *q, int idx);
|
||||
//atic void forest_excluded (WIN_t *q);
|
||||
/*------ Interactive Input Tertiary support ----------------------------*/
|
||||
//atic inline int find_ofs (const WIN_t *q, const char *buf);
|
||||
//atic void find_string (int ch);
|
||||
|
||||
Reference in New Issue
Block a user