]> granicus.if.org Git - procps-ng/commitdiff
top: add a program name to 'Ctrl' bottom window header <=== port of newlib bad7f2a2
authorJim Warner <james.warner@comcast.net>
Wed, 15 Jun 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Sun, 19 Jun 2022 10:58:51 +0000 (20:58 +1000)
______________________________ 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>
top/top.c

index 607084cd10b13c0fb0151eebe5e36458fa8ebf43..ae06b73df83c326394c78607125a91d81e15819e 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -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;