Improve submission latency calculation
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index ab46cbe7aadb163578517578a7b41b962c6711c4..6234c42b3a91b32305110f96e9e216472a9f537c 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -555,3 +555,14 @@ long io_u_queued_complete(struct thread_data *td, int min_events,
 
        return -1;
 }
+
+/*
+ * Call when io_u is really queued, to update the submission latency.
+ */
+void io_u_queued(struct thread_data *td, struct io_u *io_u)
+{
+       unsigned long slat_time;
+
+       slat_time = mtime_since(&io_u->start_time, &io_u->issue_time);
+       add_slat_sample(td, io_u->ddir, slat_time);
+}