Merge git://git.kernel.dk/fio into steady-state
[fio.git] / libfio.c
index 20ce7cdf7d99f315777ed9d12813866154df765a..960daf69f6c0d145998a58bbbcdb225b861c60d6 100644 (file)
--- a/libfio.c
+++ b/libfio.c
@@ -34,6 +34,7 @@
 #include "os/os.h"
 #include "filelock.h"
 #include "helper_thread.h"
+#include "filehash.h"
 
 /*
  * Just expose an empty list, if the OS does not support disk util stats
@@ -134,7 +135,6 @@ void clear_io_state(struct thread_data *td, int all)
 
 void reset_all_stats(struct thread_data *td)
 {
-       struct timeval tv;
        int i;
 
        reset_io_counters(td, 1);
@@ -148,12 +148,11 @@ void reset_all_stats(struct thread_data *td)
                td->rwmix_issues = 0;
        }
 
-       fio_gettime(&tv, NULL);
-       memcpy(&td->epoch, &tv, sizeof(tv));
-       memcpy(&td->start, &tv, sizeof(tv));
-       memcpy(&td->iops_sample_time, &tv, sizeof(tv));
-       memcpy(&td->bw_sample_time, &tv, sizeof(tv));
-       memcpy(&td->ss.prev_time, &tv, sizeof(tv));
+       set_epoch_time(td, td->o.log_unix_epoch);
+       memcpy(&td->start, &td->epoch, sizeof(struct timeval));
+       memcpy(&td->iops_sample_time, &td->epoch, sizeof(struct timeval));
+       memcpy(&td->bw_sample_time, &td->epoch, sizeof(struct timeval));
+       memcpy(&td->ss.prev_time, &td->epoch, sizeof(struct timeval));
 
        lat_target_reset(td);
        clear_rusage_stat(td);
@@ -379,6 +378,8 @@ int initialize_fio(char *envp[])
                return 1;
        }
 
+       file_hash_init();
+
        /*
         * We need locale for number printing, if it isn't set then just
         * go with the US format.