Add support for specific clock sources
[fio.git] / time.c
diff --git a/time.c b/time.c
index 6397f20e01dc8e2ce0cb0067311c155e9c7dce82..5755b67e78e7c71e0b33f426ea807ec19bb6f9d0 100644 (file)
--- a/time.c
+++ b/time.c
@@ -5,6 +5,7 @@
 
 static struct timeval genesis;
 static unsigned long ns_granularity;
+unsigned long long genesis_cycles;
 
 unsigned long long utime_since(struct timeval *s, struct timeval *e)
 {
@@ -150,10 +151,12 @@ int ramp_time_over(struct thread_data *td)
        return 0;
 }
 
-static void fio_init time_init(void)
+void fio_init fio_time_init(void)
 {
        int i;
 
+       fio_clock_init();
+
        /*
         * Check the granularity of the nanosleep function
         */
@@ -177,6 +180,7 @@ static void fio_init time_init(void)
 void set_genesis_time(void)
 {
        fio_gettime(&genesis, NULL);
+       genesis_cycles = get_cpu_clock();
 }
 
 void fill_start_time(struct timeval *t)