From aa60bc582119e8fcd4588dc5820c1cbcab599984 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 4 Jan 2013 13:24:52 +0100 Subject: [PATCH] time: convert to uint64_t Signed-off-by: Jens Axboe --- gettime.c | 12 ++++++------ time.c | 2 +- time.h | 13 ++++++------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/gettime.c b/gettime.c index 3011d744..1648b17b 100644 --- a/gettime.c +++ b/gettime.c @@ -324,10 +324,10 @@ void fio_clock_init(void) log_info("fio: clocksource=cpu may not be reliable\n"); } -unsigned long long utime_since(struct timeval *s, struct timeval *e) +uint64_t utime_since(struct timeval *s, struct timeval *e) { long sec, usec; - unsigned long long ret; + uint64_t ret; sec = e->tv_sec - s->tv_sec; usec = e->tv_usec - s->tv_usec; @@ -347,7 +347,7 @@ unsigned long long utime_since(struct timeval *s, struct timeval *e) return ret; } -unsigned long long utime_since_now(struct timeval *s) +uint64_t utime_since_now(struct timeval *s) { struct timeval t; @@ -355,7 +355,7 @@ unsigned long long utime_since_now(struct timeval *s) return utime_since(s, &t); } -unsigned long mtime_since(struct timeval *s, struct timeval *e) +uint64_t mtime_since(struct timeval *s, struct timeval *e) { long sec, usec, ret; @@ -376,7 +376,7 @@ unsigned long mtime_since(struct timeval *s, struct timeval *e) return ret; } -unsigned long mtime_since_now(struct timeval *s) +uint64_t mtime_since_now(struct timeval *s) { struct timeval t; void *p = __builtin_return_address(0); @@ -385,7 +385,7 @@ unsigned long mtime_since_now(struct timeval *s) return mtime_since(s, &t); } -unsigned long time_since_now(struct timeval *s) +uint64_t time_since_now(struct timeval *s) { return mtime_since_now(s) / 1000; } diff --git a/time.c b/time.c index c4d1d4c7..17f9f6fc 100644 --- a/time.c +++ b/time.c @@ -53,7 +53,7 @@ void usec_sleep(struct thread_data *td, unsigned long usec) } while (!td->terminate); } -unsigned long mtime_since_genesis(void) +uint64_t mtime_since_genesis(void) { return mtime_since_now(&genesis); } diff --git a/time.h b/time.h index 3824102d..d8351912 100644 --- a/time.h +++ b/time.h @@ -1,19 +1,18 @@ #ifndef FIO_TIME_H #define FIO_TIME_H -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 mtime_since_now(struct timeval *); -extern unsigned long time_since_now(struct timeval *); -extern unsigned long mtime_since_genesis(void); +extern uint64_t utime_since(struct timeval *, struct timeval *); +extern uint64_t utime_since_now(struct timeval *); +extern uint64_t mtime_since(struct timeval *, struct timeval *); +extern uint64_t mtime_since_now(struct timeval *); +extern uint64_t time_since_now(struct timeval *); +extern uint64_t 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 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); #endif -- 2.25.1