top: add a program name to 'Ctrl' bottom window header <=== port of newlib bad7f2a2

______________________________ original newlib message

This minor addition to that new 'Ctrl' feature is more
important than it seems. It's responsible for alerting
yours truly to the 'LIBPROC_HIDE_KERNEL' bug addressed
in the very next commit. All this while, program names <=== not in this branch, cookie
for some tasks would be mysteriously replaced with the
kernel 'kworker' names. However, customary clutter for
the top process display tended to obscure such a fact.

[ and, of course, to notice the problem in the first ]
[ place required one to have the command line toggle ]
[ 'off' or perhaps to toggle its state 'on' & 'off'. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2022-06-15 00:00:00 -05:00 committed by Craig Small
parent 261ed4e716
commit 60bf133184

View File

@ -4858,6 +4858,8 @@ static void wins_tag_cmdline (void) {
}
if (i < Frame_maxtask) {
snprintf(buf, sizeof(buf), "command line for pid %d:", Tagged_task);
snprintf(buf, sizeof(buf), " command line for pid %d, %s"
, Tagged_task, Curwin->ppt[i]->cmd);
p = *Curwin->ppt[i]->cmdline;
if (!p || !*p) p = "n/a";
Tagged_rsvd = 1 + TAGGED_RSVD + (strlen(p) / Screen_cols);
@ -4885,6 +4887,8 @@ static void wins_tag_generic (void) {
}
if (i < Frame_maxtask) {
snprintf(buf, sizeof(buf), "%s for pid %d:", Tagged_name, Tagged_task);
snprintf(buf, sizeof(buf), " %s for pid %d, %s"
, Tagged_name, Tagged_task, Curwin->ppt[i]->cmd);
switch (Tagged_lflg) {
case (L_CGROUP): // Ctrl-G
p = *Curwin->ppt[i]->cgroup;