We cannot control constructor ordering easily, hence the check
code was also in fio_gettime().
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
gtod_log_caller(caller);
#endif
gtod_log_caller(caller);
#endif
-repeat:
- if (!clock_gettime_works)
+ if (!clock_gettime_works) {
+gtod:
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) {
clock_gettime_works = 0;
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) {
clock_gettime_works = 0;
}
tp->tv_sec = ts.tv_sec;
tp->tv_usec = ts.tv_nsec / 1000;
}
}
}
tp->tv_sec = ts.tv_sec;
tp->tv_usec = ts.tv_nsec / 1000;
}
}
-
-static void fio_init check_clock(void)
-{
- struct timespec ts;
-
- if (clock_getres(CLOCK_MONOTONIC, &ts) < 0)
- clock_gettime_works = 0;
-}