]> granicus.if.org Git - sysstat/commitdiff
Add %wait field to "pidstat -h" output
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 18 Feb 2017 10:26:33 +0000 (11:26 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 18 Feb 2017 10:26:33 +0000 (11:26 +0100)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
pidstat.c

index 956783e83d9c986a745f5d6c96e40738e91ab21b..9165bdda07696fb451851e587fc38520455dfca8 100644 (file)
--- a/pidstat.c
+++ b/pidstat.c
@@ -1402,7 +1402,7 @@ int write_pid_task_all_stats(int prev, int curr, int dis,
        if (dis) {
                PRINT_ID_HDR("#      Time", pidflag);
                if (DISPLAY_CPU(actflag)) {
-                       printf("    %%usr %%system  %%guest    %%CPU   CPU");
+                       printf("    %%usr %%system  %%guest   %%wait    %%CPU   CPU");
                }
                if (DISPLAY_MEM(actflag)) {
                        printf("  minflt/s  majflt/s     VSZ     RSS   %%MEM");
@@ -1435,13 +1435,14 @@ int write_pid_task_all_stats(int prev, int curr, int dis,
                __print_line_id(pstc, '0');
 
                if (DISPLAY_CPU(actflag)) {
-                       cprintf_pc(4, 7, 2,
+                       cprintf_pc(5, 7, 2,
                                   (pstc->utime - pstc->gtime) < (pstp->utime - pstp->gtime) ?
                                   0.0 :
                                   SP_VALUE_100(pstp->utime - pstp->gtime,
                                            pstc->utime - pstc->gtime, itv),
                                   SP_VALUE_100(pstp->stime,  pstc->stime, itv),
                                   SP_VALUE_100(pstp->gtime,  pstc->gtime, itv),
+                                  SP_VALUE_100(pstp->wtime, pstc->wtime, itv),
                                   /* User time already includes guest time */
                                   IRIX_MODE_OFF(pidflag) ?
                                   SP_VALUE_100(pstp->utime + pstp->stime,