From f52e919826839eaba90903b67fe02042159a0023 Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Sun, 16 Apr 2017 15:04:28 -0400 Subject: [PATCH] gettime: make utime_since_now and mtime_since_now consistent in how they record the caller and put this all behind FIO_DEBUG_TIME Signed-off-by: Jens Axboe --- gettime.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gettime.c b/gettime.c index 85ba7cba..628aad64 100644 --- a/gettime.c +++ b/gettime.c @@ -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); } -- 2.25.1