gettime: Introduce fio_get_mono_time()
authorBart Van Assche <bvanassche@acm.org>
Sun, 20 Sep 2020 18:40:26 +0000 (11:40 -0700)
committerBart Van Assche <bvanassche@acm.org>
Sun, 20 Sep 2020 23:09:30 +0000 (16:09 -0700)
commit69212fc41c0420f8caf272a0cc270194edbddfe7
tree9eae986cb31d5b8ddce70297178b85dafe305da4
parent187f39063e1b0a7baeda20a9f4f2406327ec0d41
gettime: Introduce fio_get_mono_time()

Introduce a new function for querying the monotonic clock, something that
is necessary in every context where relative time is measured and where
wall clock time jumps should have no effect. Remove fill_clock_gettime()
since the only contexts where CLOCK_MONOTONIC_RAW are used are
get_cycles_per_msec() and --clocksource=clock_gettime. I think both contexts
should use CLOCK_MONOTONIC instead of its raw variant such that the values
read from the clock are frequency adjusted (a computer clock crystal can
deviate up to 500 ppm from its nominal frequency).

This patch improves accuracy of the helper_thread code on Darwin. Darwin
supports CLOCK_MONOTONIC but not pthread_condattr_setclock(). In other
words, this patch causes the helper thread code to switch from the
real-time clock to the monotonic clock on Darwin.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
configure
engines/posixaio.c
gettime.c
gettime.h
helper_thread.c