Add gettime.h
authorJens Axboe <axboe@kernel.dk>
Thu, 9 Feb 2012 14:02:39 +0000 (15:02 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 9 Feb 2012 14:02:39 +0000 (15:02 +0100)
time.h is a mix of gettime.c and time.c

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fio.h
gettime.c
gettime.h [new file with mode: 0644]
time.h

diff --git a/fio.h b/fio.h
index 9eb09b2c325f89282436102becff5a7c12be2111..c462980255edef7d9bcf2032b71430fe4a939ff7 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -33,6 +33,7 @@ struct thread_data;
 #include "options.h"
 #include "profile.h"
 #include "time.h"
 #include "options.h"
 #include "profile.h"
 #include "time.h"
+#include "gettime.h"
 #include "lib/getopt.h"
 #include "lib/rand.h"
 #include "server.h"
 #include "lib/getopt.h"
 #include "lib/rand.h"
 #include "server.h"
index 2037354d0116a122ffb9b698c55b7b9aacbce86b..cf0d664030d2b2d82267b79e15ee53d04205bb0d 100644 (file)
--- a/gettime.c
+++ b/gettime.c
@@ -273,7 +273,7 @@ void fio_gtod_init(void)
        assert(fio_tv);
 }
 
        assert(fio_tv);
 }
 
-void fio_gtod_update(void)
+static void fio_gtod_update(void)
 {
        gettimeofday(fio_tv, NULL);
 }
 {
        gettimeofday(fio_tv, NULL);
 }
diff --git a/gettime.h b/gettime.h
new file mode 100644 (file)
index 0000000..87cc895
--- /dev/null
+++ b/gettime.h
@@ -0,0 +1,18 @@
+#ifndef FIO_GETTIME_H
+#define FIO_GETTIME_H
+
+/*
+ * Clock sources
+ */
+enum fio_cs {
+       CS_GTOD         = 1,
+       CS_CGETTIME,
+       CS_CPUCLOCK,
+};
+
+extern void fio_gettime(struct timeval *, void *);
+extern void fio_gtod_init(void);
+extern void fio_clock_init(void);
+extern int fio_start_gtod_thread(void);
+
+#endif
diff --git a/time.h b/time.h
index bc7fe3702942d57b66d5572d7075df31afbb63a2..3824102d7497268189d4b1c12b7bbdb29b58b669 100644 (file)
--- a/time.h
+++ b/time.h
@@ -1,15 +1,6 @@
 #ifndef FIO_TIME_H
 #define FIO_TIME_H
 
 #ifndef FIO_TIME_H
 #define FIO_TIME_H
 
-/*
- * Clock sources
- */
-enum fio_cs {
-       CS_GTOD         = 1,
-       CS_CGETTIME,
-       CS_CPUCLOCK,
-};
-
 extern unsigned long long utime_since(struct timeval *, struct timeval *);
 extern unsigned long long utime_since_now(struct timeval *);
 extern unsigned long mtime_since(struct timeval *, struct timeval *);
 extern unsigned long long utime_since(struct timeval *, struct timeval *);
 extern unsigned long long utime_since_now(struct timeval *);
 extern unsigned long mtime_since(struct timeval *, struct timeval *);
@@ -19,15 +10,10 @@ extern unsigned long mtime_since_genesis(void);
 extern void usec_spin(unsigned int);
 extern void usec_sleep(struct thread_data *, unsigned long);
 extern void fill_start_time(struct timeval *);
 extern void usec_spin(unsigned int);
 extern void usec_sleep(struct thread_data *, unsigned long);
 extern void fill_start_time(struct timeval *);
-extern void fio_gettime(struct timeval *, void *);
-extern void fio_gtod_init(void);
-extern void fio_clock_init(void);
-extern void fio_gtod_update(void);
 extern void set_genesis_time(void);
 extern int ramp_time_over(struct thread_data *);
 extern int in_ramp_time(struct thread_data *);
 extern unsigned long long genesis_cycles;
 extern void fio_time_init(void);
 extern void set_genesis_time(void);
 extern int ramp_time_over(struct thread_data *);
 extern int in_ramp_time(struct thread_data *);
 extern unsigned long long genesis_cycles;
 extern void fio_time_init(void);
-extern int fio_start_gtod_thread(void);
 
 #endif
 
 #endif