Ensure that fio_get_kb_base() doesn't assume 'data' is thread_options
[fio.git] / backend.c
index b92877efd1ca8a167555cd753387df6eaf39fbc5..ee395bd0ea5795ca6a8d9da175b73df574bad412 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -346,7 +346,7 @@ static inline int runtime_exceeded(struct thread_data *td, struct timeval *t)
                return 0;
        if (!td->o.timeout)
                return 0;
-       if (mtime_since(&td->epoch, t) >= td->o.timeout )
+       if (utime_since(&td->epoch, t) >= td->o.timeout)
                return 1;
 
        return 0;
@@ -1461,6 +1461,7 @@ static void *thread_main(void *data)
        fio_unpin_memory(td);
 
        fio_mutex_down(writeout_mutex);
+       finalize_logs(td);
        if (td->bw_log) {
                if (o->bw_log_file) {
                        finish_log_named(td, td->bw_log,
@@ -1682,8 +1683,8 @@ static void do_usleep(unsigned int usecs)
 static void run_threads(void)
 {
        struct thread_data *td;
-       unsigned long spent;
        unsigned int i, todo, nr_running, m_rate, t_rate, nr_started;
+       uint64_t spent;
 
        if (fio_gtod_offload && fio_start_gtod_thread())
                return;
@@ -1781,7 +1782,7 @@ static void run_threads(void)
                        }
 
                        if (td->o.start_delay) {
-                               spent = mtime_since_genesis();
+                               spent = utime_since_genesis();
 
                                if (td->o.start_delay > spent)
                                        continue;