Only memcpy last issue time when using iolog replay
authorJens Axboe <jens.axboe@oracle.com>
Thu, 16 Oct 2008 18:33:51 +0000 (20:33 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 16 Oct 2008 18:33:51 +0000 (20:33 +0200)
Part of a series that'll allow switching off various time measurements
to avoid impacting system performance too much.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
ioengines.c

index e447539c2051d1ece8714669e53a996a4ca3cbd3..1688c633db66233fe55caf8284f195d4a7bac8a0 100644 (file)
@@ -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);
 
        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));
 
                /*
                                        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);
 
        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
 
                /*
                 * async engine, set the timeout here