aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--procps/top.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/procps/top.c b/procps/top.c
index 79915697c..f514df78a 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -522,12 +522,8 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width)
522 /* what info of the processes is shown */ 522 /* what info of the processes is shown */
523 printf(OPT_BATCH_MODE ? "%.*s" : "\e[7m%.*s\e[0m", scr_width, 523 printf(OPT_BATCH_MODE ? "%.*s" : "\e[7m%.*s\e[0m", scr_width,
524 " PID PPID USER STAT VSZ %MEM" 524 " PID PPID USER STAT VSZ %MEM"
525#if ENABLE_FEATURE_TOP_SMP_PROCESS 525 IF_FEATURE_TOP_SMP_PROCESS(" CPU")
526 " CPU" 526 IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(" %CPU")
527#endif
528#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
529 " %CPU"
530#endif
531 " COMMAND"); 527 " COMMAND");
532 lines_rem--; 528 lines_rem--;
533 529
@@ -606,22 +602,14 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width)
606 /* PID PPID USER STAT VSZ %MEM [%CPU] COMMAND */ 602 /* PID PPID USER STAT VSZ %MEM [%CPU] COMMAND */
607 col = snprintf(line_buf, scr_width, 603 col = snprintf(line_buf, scr_width,
608 "\n" "%5u%6u %-8.8s %s%s" FMT 604 "\n" "%5u%6u %-8.8s %s%s" FMT
609#if ENABLE_FEATURE_TOP_SMP_PROCESS 605 IF_FEATURE_TOP_SMP_PROCESS(" %3d")
610 " %3d" 606 IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(FMT)
611#endif
612#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
613 FMT
614#endif
615 " ", 607 " ",
616 s->pid, s->ppid, get_cached_username(s->uid), 608 s->pid, s->ppid, get_cached_username(s->uid),
617 s->state, vsz_str_buf, 609 s->state, vsz_str_buf,
618 SHOW_STAT(pmem) 610 SHOW_STAT(pmem)
619#if ENABLE_FEATURE_TOP_SMP_PROCESS 611 IF_FEATURE_TOP_SMP_PROCESS(, s->last_seen_on_cpu)
620 , s->last_seen_on_cpu 612 IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(, SHOW_STAT(pcpu))
621#endif
622#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
623 , SHOW_STAT(pcpu)
624#endif
625 ); 613 );
626 if ((int)(col + 1) < scr_width) 614 if ((int)(col + 1) < scr_width)
627 read_cmdline(line_buf + col, scr_width - col, s->pid, s->comm); 615 read_cmdline(line_buf + col, scr_width - col, s->pid, s->comm);