From d0c153284c1e6505e711c71e6412e6fef02853b8 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 16 Oct 2008 20:33:51 +0200 Subject: [PATCH] Only memcpy last issue time when using iolog replay Part of a series that'll allow switching off various time measurements to avoid impacting system performance too much. Signed-off-by: Jens Axboe --- ioengines.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ioengines.c b/ioengines.c index e447539c..1688c633 100644 --- a/ioengines.c +++ b/ioengines.c @@ -227,7 +227,12 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) if (td->io_ops->flags & FIO_SYNCIO) { fio_gettime(&io_u->issue_time, NULL); - memcpy(&td->last_issue, &io_u->issue_time, + + /* + * only used for iolog + */ + if (td->o.read_iolog_file) + memcpy(&td->last_issue, &io_u->issue_time, sizeof(struct timeval)); /* @@ -272,8 +277,13 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) if ((td->io_ops->flags & FIO_SYNCIO) == 0) { fio_gettime(&io_u->issue_time, NULL); - memcpy(&td->last_issue, &io_u->issue_time, - sizeof(struct timeval)); + + /* + * only used for iolog + */ + if (td->o.read_iolog_file) + memcpy(&td->last_issue, &io_u->issue_time, + sizeof(struct timeval)); /* * async engine, set the timeout here -- 2.25.1