static unsigned long last_cycles;
int tsc_reliable = 0;
#endif
-static struct timeval last_tv;
-static int last_tv_valid;
+static __thread struct timeval last_tv;
+static __thread int last_tv_valid;
enum fio_cs fio_clock_source = FIO_PREFERRED_CLOCK_SOURCE;
int fio_clock_source_set = 0;
uint64_t seq = 0;
int i;
+ fio_debug |= 1U << FD_TIME;
+ calibrate_cpu_clock();
+ fio_debug &= ~(1U << FD_TIME);
+
threads = malloc(nr_cpus * sizeof(struct clock_thread));
tentries = CLOCK_ENTRIES * nr_cpus;
entries = malloc(tentries * sizeof(struct clock_entry));