Add FIO_PREFERRED_CLOCK_SOURCE to allow selection of clock source on a per-platform...
authorBruce Cran <bruce@cran.org.uk>
Mon, 20 Feb 2012 17:07:32 +0000 (17:07 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 20 Feb 2012 18:33:30 +0000 (19:33 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
gettime.c
os/os.h

index cf0d664030d2b2d82267b79e15ee53d04205bb0d..e8f5ab55af38381e125a961407f876a82bcfb207 100644 (file)
--- a/gettime.c
+++ b/gettime.c
@@ -24,7 +24,7 @@ int fio_gtod_offload = 0;
 int fio_gtod_cpu = -1;
 static pthread_t gtod_thread;
 
-enum fio_cs fio_clock_source = CS_GTOD;
+enum fio_cs fio_clock_source = FIO_PREFERRED_CLOCK_SOURCE;
 
 #ifdef FIO_DEBUG_TIME
 
diff --git a/os/os.h b/os/os.h
index cbb476fe532a63375d7bcea6cc9d99f978194381..c10cb127a2126ab084162c4945eaba7ee7d52c41 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -129,6 +129,10 @@ typedef unsigned long os_cpu_mask_t;
 #define FIO_OS_PATH_SEPARATOR  "/"
 #endif
 
+#ifndef FIO_PREFERRED_CLOCK_SOURCE
+#define FIO_PREFERRED_CLOCK_SOURCE     CS_CGETTIME
+#endif
+
 #ifndef FIO_MAX_JOBS
 #define FIO_MAX_JOBS           2048
 #endif