Fix problem with mixing is_backend and terse_output
authorJens Axboe <axboe@kernel.dk>
Sun, 16 Oct 2011 09:50:31 +0000 (11:50 +0200)
committerJens Axboe <axboe@kernel.dk>
Sun, 16 Oct 2011 09:50:31 +0000 (11:50 +0200)
Always send disk util and group_run_stats, even if terse
output got set in the server. Also fixes a disk util leak
for !terse_output.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
stat.c

diff --git a/stat.c b/stat.c
index d54aa85d82d4fbcfd2053539582293e71877b44d..19b36961aa4854f0e3fb27a692b04ed5f52cb9e9 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1012,25 +1012,23 @@ void show_run_stats(void)
                        show_thread_status(ts, rs);
        }
 
-       if (!terse_output) {
-               for (i = 0; i < groupid + 1; i++) {
-                       rs = &runstats[i];
-
-                       rs->groupid = i;
-                       if (is_backend)
-                               fio_server_send_gs(rs);
-                       else
-                               show_group_stats(rs);
-               }
+       for (i = 0; i < groupid + 1; i++) {
+               rs = &runstats[i];
 
+               rs->groupid = i;
                if (is_backend)
-                       fio_server_send_du();
-               else
-                       show_disk_util(0);
-
-               free_disk_util();
+                       fio_server_send_gs(rs);
+               else if (!terse_output)
+                       show_group_stats(rs);
        }
 
+       if (is_backend)
+               fio_server_send_du();
+       else if (!terse_output)
+               show_disk_util(0);
+
+       free_disk_util();
+
        free(runstats);
        free(threadstats);
 }