+ inv_cycles_per_usec = 16777216UL / cycles_per_usec;
+ max_cycles_for_mult = ~0ULL / inv_cycles_per_usec;
+ dprint(FD_TIME, "inv_cycles_per_usec=%lu\n", inv_cycles_per_usec);
+#ifdef ARCH_CPU_CLOCK_WRAPS
+ cycles_start = get_cpu_clock();
+ dprint(FD_TIME, "cycles_start=%llu\n", cycles_start);
+#endif
+ return 0;
+}
+#else
+static int calibrate_cpu_clock(void)
+{
+#ifdef ARCH_CPU_CLOCK_CYCLES_PER_USEC
+ return 0;
+#else
+ return 1;
+#endif
+}
+#endif // ARCH_HAVE_CPU_CLOCK
+
+#ifndef CONFIG_TLS_THREAD
+void fio_local_clock_init(int is_thread)
+{
+ struct tv_valid *t;
+
+ t = calloc(1, sizeof(*t));
+ if (pthread_setspecific(tv_tls_key, t)) {
+ log_err("fio: can't set TLS key\n");
+ assert(0);
+ }
+}
+
+static void kill_tv_tls_key(void *data)
+{
+ free(data);