From: Sebastien GODARD Date: Tue, 27 Apr 2021 06:58:47 +0000 (+0200) Subject: pidstat: Simplify use of P_D_PID flag X-Git-Tag: v12.5.4~3^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=563c2ac935872f6f83f8117b300f528b63e0706c;p=sysstat pidstat: Simplify use of P_D_PID flag P_D_PID flag is set only when option -p is used on the command line. Signed-off-by: Sebastien GODARD --- diff --git a/pidstat.c b/pidstat.c index c7c3c35..78dad1c 100644 --- a/pidstat.c +++ b/pidstat.c @@ -185,7 +185,11 @@ void check_flags(void) } if (!DISPLAY_PID(pidflag)) { - pidflag |= P_D_ACTIVE_PID + P_D_PID + P_D_ALL_PID; + /* + * If no PIDs nor -p ALL entered on the command line then + * only active PIDs will be displayed. + */ + pidflag |= P_D_ACTIVE_PID + P_D_ALL_PID; } if (!tskflag) { @@ -972,7 +976,7 @@ void read_stats(int curr) __closedir(dir); } - else if (DISPLAY_PID(pidflag)) { + else { /* Read stats for each PID in the list */ for (plist = pid_list; plist != NULL; plist = plist->next) {