From: Vincent Fu Date: Sun, 16 Apr 2017 19:04:28 +0000 (-0400) Subject: gettime: make utime_since_now and mtime_since_now consistent in how they record the... X-Git-Tag: fio-2.20~6 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=f52e919826839eaba90903b67fe02042159a0023 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 --- 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); }