Strip blank end/front of filenames
[fio.git] / stat.c
diff --git a/stat.c b/stat.c
index 8d391a35d4dec7058e0670bde73685d3fa176937..85d55b4ca91e825320c6c3a3ae26938a89a2afc9 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -249,7 +249,8 @@ void init_disk_util(struct thread_data *td)
        dev_t dev;
        char *p;
 
-       if (!td->do_disk_util || (td->io_ops->flags & FIO_DISKLESSIO))
+       if (!td->do_disk_util ||
+           (td->io_ops->flags & (FIO_DISKLESSIO | FIO_NODISKUTIL)))
                return;
 
        /*
@@ -669,18 +670,27 @@ void show_run_stats(void)
                        ts->slat_stat[j].min_val = -1UL;
                        ts->bw_stat[j].min_val = -1UL;
                }
+               ts->groupid = -1;
        }
 
        j = 0;
        last_ts = -1;
        idx = 0;
        for_each_td(td, i) {
+               if (idx && (!td->group_reporting ||
+                   (td->group_reporting && last_ts != td->groupid))) {
+                       idx = 0;
+                       j++;
+               }
+
+               last_ts = td->groupid;
+
                ts = &threadstats[j];
 
                idx++;
                ts->members++;
 
-               if (!ts->groupid) {
+               if (ts->groupid == -1) {
                        /*
                         * These are per-group shared already
                         */
@@ -724,21 +734,6 @@ void show_run_stats(void)
                        ts->total_io_u[k] += td->ts.total_io_u[k];
 
                ts->total_run_time += td->ts.total_run_time;
-
-               if (!td->group_reporting) {
-                       idx = 0;
-                       j++;
-                       continue;
-               }
-               if (last_ts == td->groupid)
-                       continue;
-
-               if (last_ts != -1) {
-                       idx = 0;
-                       j++;
-               }
-
-               last_ts = td->groupid;
        }
 
        for (i = 0; i < nr_ts; i++) {