Fix rwlock error messages to specify the correct function names.
[fio.git] / stat.c
diff --git a/stat.c b/stat.c
index 759bcef90adb6e7744882e2b76f342001de9ae4c..59f37184117ba3ac0c225ae6b33ddc3607b83efe 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1358,10 +1358,10 @@ void show_run_stats(void)
 
        if (is_backend)
                fio_server_send_du();
-       else if (output_format == FIO_OUTPUT_NORMAL)
+       else if (output_format == FIO_OUTPUT_NORMAL) {
                show_disk_util(0, NULL);
-
-       show_idle_prof_stats(FIO_OUTPUT_NORMAL, NULL);
+               show_idle_prof_stats(FIO_OUTPUT_NORMAL, NULL);
+       }
 
        free(runstats);
        free(threadstats);
@@ -1386,13 +1386,21 @@ static void *__show_running_run_stats(void *arg)
                if (td_trim(td) && td->io_bytes[DDIR_TRIM])
                        td->ts.runtime[DDIR_TRIM] += rt[i];
 
-               update_rusage_stat(td);
+               td->update_rusage = 1;
                td->ts.io_bytes[DDIR_READ] = td->io_bytes[DDIR_READ];
                td->ts.io_bytes[DDIR_WRITE] = td->io_bytes[DDIR_WRITE];
                td->ts.io_bytes[DDIR_TRIM] = td->io_bytes[DDIR_TRIM];
                td->ts.total_run_time = mtime_since(&td->epoch, &tv);
        }
 
+       for_each_td(td, i) {
+               if (td->rusage_sem) {
+                       td->update_rusage = 1;
+                       fio_mutex_down(td->rusage_sem);
+               }
+               td->update_rusage = 0;
+       }
+
        show_run_stats();
 
        for_each_td(td, i) {