If we're not updating issue_time it doesn't make sense to update last_issue. We should also be updating last_issue in libaio and io_uring when we record issue_time. Signed-off-by: Vincent Fu <vincent.fu@xxxxxxxxxxx> --- engines/io_uring.c | 6 ++++++ engines/libaio.c | 6 ++++++ ioengines.c | 30 ++++++++++++++++-------------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/engines/io_uring.c b/engines/io_uring.c index 474d215c..cffc7371 100644 --- a/engines/io_uring.c +++ b/engines/io_uring.c @@ -608,6 +608,12 @@ static void fio_ioring_queued(struct thread_data *td, int start, int nr) start++; } + + /* + * only used for iolog + */ + if (td->o.read_iolog_file) + memcpy(&td->last_issue, &now, sizeof(now)); } static int fio_ioring_commit(struct thread_data *td) diff --git a/engines/libaio.c b/engines/libaio.c index da5279f4..33b8c12f 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -368,6 +368,12 @@ static void fio_libaio_queued(struct thread_data *td, struct io_u **io_us, memcpy(&io_u->issue_time, &now, sizeof(now)); io_u_queued(td, io_u); } + + /* + * only used for iolog + */ + if (td->o.read_iolog_file) + memcpy(&td->last_issue, &now, sizeof(now)); } static int fio_libaio_commit(struct thread_data *td) diff --git a/ioengines.c b/ioengines.c index e4ad698c..e2316ee4 100644 --- a/ioengines.c +++ b/ioengines.c @@ -358,15 +358,16 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u) if (td_ioengine_flagged(td, FIO_SYNCIO) || async_ioengine_sync_trim(td, io_u)) { - if (fio_fill_issue_time(td)) + if (fio_fill_issue_time(td)) { fio_gettime(&io_u->issue_time, NULL); - /* - * only used for iolog - */ - if (td->o.read_iolog_file) - memcpy(&td->last_issue, &io_u->issue_time, - sizeof(io_u->issue_time)); + /* + * only used for iolog + */ + if (td->o.read_iolog_file) + memcpy(&td->last_issue, &io_u->issue_time, + sizeof(io_u->issue_time)); + } } @@ -443,15 +444,16 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u) if (!td_ioengine_flagged(td, FIO_SYNCIO) && !async_ioengine_sync_trim(td, io_u)) { if (fio_fill_issue_time(td) && - !td_ioengine_flagged(td, FIO_ASYNCIO_SETS_ISSUE_TIME)) + !td_ioengine_flagged(td, FIO_ASYNCIO_SETS_ISSUE_TIME)) { fio_gettime(&io_u->issue_time, NULL); - /* - * only used for iolog - */ - if (td->o.read_iolog_file) - memcpy(&td->last_issue, &io_u->issue_time, - sizeof(io_u->issue_time)); + /* + * only used for iolog + */ + if (td->o.read_iolog_file) + memcpy(&td->last_issue, &io_u->issue_time, + sizeof(io_u->issue_time)); + } } return ret; -- 2.25.1