binject: don't use void* for pointer arithmetic (gcc)
[fio.git] / gettime.c
index 73b48b0463a0efb00144bae289d6de377b197dbf..628aad640810e4c01ef2892bd6c2158c0d5c84a2 100644 (file)
--- a/gettime.c
+++ b/gettime.c
@@ -381,7 +381,7 @@ void fio_clock_init(void)
 
 uint64_t utime_since(const struct timeval *s, const struct timeval *e)
 {
-       long sec, usec;
+       int64_t sec, usec;
 
        sec = e->tv_sec - s->tv_sec;
        usec = e->tv_usec - s->tv_usec;
@@ -402,8 +402,14 @@ uint64_t utime_since(const struct timeval *s, const struct timeval *e)
 uint64_t utime_since_now(const struct timeval *s)
 {
        struct timeval t;
+#ifdef FIO_DEBUG_TIME
+       void *p = __builtin_return_address(0);
 
+       fio_gettime(&t, p);
+#else
        fio_gettime(&t, NULL);
+#endif
+
        return utime_since(s, &t);
 }
 
@@ -429,9 +435,14 @@ uint64_t mtime_since(const struct timeval *s, const struct timeval *e)
 uint64_t mtime_since_now(const struct timeval *s)
 {
        struct timeval t;
+#ifdef FIO_DEBUG_TIME
        void *p = __builtin_return_address(0);
 
        fio_gettime(&t, p);
+#else
+       fio_gettime(&t, NULL);
+#endif
+
        return mtime_since(s, &t);
 }