Merge branch 'master' into gfio
[fio.git] / backend.c
index 9aa2a28551234220b6b1ba12c3f504eff0e16075..49d6bc7cb2cc7da2f9842cca78150a732ad07c6a 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -51,6 +51,7 @@
 #include "memalign.h"
 #include "server.h"
 #include "lib/getrusage.h"
+#include "idletime.h"
 
 static pthread_t disk_util_thread;
 static struct fio_mutex *disk_thread_mutex;
@@ -1508,6 +1509,8 @@ static void run_threads(void)
 
        if (fio_gtod_offload && fio_start_gtod_thread())
                return;
+       
+       fio_idle_prof_init();
 
        set_sig_handlers();
 
@@ -1573,6 +1576,9 @@ static void run_threads(void)
                }
        }
 
+       /* start idle threads before io threads start to run */
+       fio_idle_prof_start();
+
        set_genesis_time();
 
        while (todo) {
@@ -1727,6 +1733,8 @@ static void run_threads(void)
                usleep(10000);
        }
 
+       fio_idle_prof_stop();
+
        update_io_ticks();
 }