From 12d9d841526ad75a67bb43a90edeefd05f85f11e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 16 Oct 2008 21:26:10 +0200 Subject: [PATCH] Issue time fixup for guasi/libaio Signed-off-by: Jens Axboe --- engines/guasi.c | 3 +++ engines/libaio.c | 3 +++ fio.h | 9 +++++++++ ioengines.c | 13 ++----------- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/engines/guasi.c b/engines/guasi.c index a7589dc8..4ae01430 100644 --- a/engines/guasi.c +++ b/engines/guasi.c @@ -141,6 +141,9 @@ static void fio_guasi_queued(struct thread_data *td, struct io_u **io_us, int nr struct io_u *io_u; struct timeval now; + if (!fio_fill_issue_time(td)) + return; + io_u_mark_submit(td, nr); fio_gettime(&now, NULL); for (i = 0; i < nr; i++) { diff --git a/engines/libaio.c b/engines/libaio.c index e6b926c3..18dcf9dd 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -118,6 +118,9 @@ static void fio_libaio_queued(struct thread_data *td, struct io_u **io_us, struct timeval now; unsigned int i; + if (!fio_fill_issue_time(td)) + return; + fio_gettime(&now, NULL); for (i = 0; i < nr; i++) { diff --git a/fio.h b/fio.h index 690afad6..ed1257cc 100644 --- a/fio.h +++ b/fio.h @@ -1040,4 +1040,13 @@ static inline void dprint_io_u(struct io_u *io_u, const char *p) #define dprint_io_u(io_u, p) #endif +static inline int fio_fill_issue_time(struct thread_data *td) +{ + if (td->o.read_iolog_file || + !td->o.disable_clat || !td->o.disable_slat || !td->o.disable_bw) + return 1; + + return 0; +} + #endif diff --git a/ioengines.c b/ioengines.c index 9daeaab0..8073d1b7 100644 --- a/ioengines.c +++ b/ioengines.c @@ -210,15 +210,6 @@ out: return r; } -static inline int get_issue_time(struct thread_data *td) -{ - if (td->o.read_iolog_file || - !td->o.disable_clat || !td->o.disable_slat || !td->o.disable_bw) - return 1; - - return 0; -} - int td_io_queue(struct thread_data *td, struct io_u *io_u) { int ret; @@ -235,7 +226,7 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) io_u->resid = 0; if (td->io_ops->flags & FIO_SYNCIO) { - if (get_issue_time(td)) + if (fio_fill_issue_time(td)) fio_gettime(&io_u->issue_time, NULL); /* @@ -279,7 +270,7 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) } if ((td->io_ops->flags & FIO_SYNCIO) == 0) { - if (get_issue_time(td)) + if (fio_fill_issue_time(td)) fio_gettime(&io_u->issue_time, NULL); /* -- 2.25.1