iolog: don't truncate time values
authorVincent Fu <vincent.fu@samsung.com>
Mon, 2 Oct 2023 13:41:54 +0000 (06:41 -0700)
committerVincent Fu <vincent.fu@samsung.com>
Mon, 2 Oct 2023 14:29:29 +0000 (14:29 +0000)
commit6f9cdcfcc7598c7d7b19c4a5120a251a80dab183
treed7289d0025f9331e7b5b3be2e9751661163eadc5
parentc95b52caacc8ef5c1235fb3754186e981b109bdb
iolog: don't truncate time values

We store iolog timestamps as 64-bit unsigned integers but when we print
timestamps in the logs we type cast them to unsigned longs. This is fine
on platforms with 64-bit longs but on platforms like Windows with 32-bit
longs this truncates the timestamps. Truncation causes problems
especially when options such as --log_unix_epoch are enabled because the
number of milliseconds since 01-01-1970 does not fit in a 32-bit
unsigned long.

Fix this by getting rid of the type cast and using PRIu64 as the format
specifier.

Fixes: https://github.com/axboe/fio/issues/1638
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
iolog.c