X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=stat.c;h=96af94ba683deb5b4de2420e7fd04cf10e7b7d88;hp=965ff9fc129dcdf791a3d67f6f3a1e516fdafa79;hb=3c746856fd63f3f7624a34ea70e226a290d9cc01;hpb=1e613c9c23932006263dd8334007865f32891a0c;ds=inline diff --git a/stat.c b/stat.c index 965ff9fc..96af94ba 100644 --- a/stat.c +++ b/stat.c @@ -2140,7 +2140,9 @@ static long add_log_sample(struct thread_data *td, struct io_log *iolog, * need to do. */ this_window = elapsed - iolog->avg_last; - if (this_window < iolog->avg_msec) { + if (elapsed < iolog->avg_last) + return iolog->avg_last - elapsed; + else if (this_window < iolog->avg_msec) { int diff = iolog->avg_msec - this_window; if (inline_log(iolog) || diff > LOG_MSEC_SLACK)