From f4b49c5523f14f39ecae250c64f8f93a9e3c1855 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sat, 14 Apr 2018 15:22:10 -0600 Subject: [PATCH] iolog: fix issue with replay rate We attempt to keep the replay rate accurate, but we mistakenly use the 'delay' value which we have decremented along the way. Store the original and use that for the stall detection. This fixes replays going quicker than they should. Signed-off-by: Jens Axboe --- iolog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iolog.c b/iolog.c index bfafc032..3f0fc22b 100644 --- a/iolog.c +++ b/iolog.c @@ -63,6 +63,7 @@ void log_file(struct thread_data *td, struct fio_file *f, static void iolog_delay(struct thread_data *td, unsigned long delay) { uint64_t usec = utime_since_now(&td->last_issue); + unsigned long orig_delay = delay; uint64_t this_delay; struct timespec ts; @@ -88,8 +89,8 @@ static void iolog_delay(struct thread_data *td, unsigned long delay) } usec = utime_since_now(&ts); - if (usec > delay) - td->time_offset = usec - delay; + if (usec > orig_delay) + td->time_offset = usec - orig_delay; else td->time_offset = 0; } -- 2.25.1