+/*
+ * Store blk_io_trace data in an ipo for later retrieval.
+ */
+static void store_ipo(struct thread_data *td, unsigned long long offset,
+ unsigned int bytes, int rw, unsigned long long ttime)
+{
+ struct io_piece *ipo = malloc(sizeof(*ipo));
+
+ memset(ipo, 0, sizeof(*ipo));
+ INIT_LIST_HEAD(&ipo->list);
+ /*
+ * the 512 is wrong here, it should be the hardware sector size...
+ */
+ ipo->offset = offset * 512;
+ ipo->len = bytes;
+ ipo->delay = ttime / 1000;
+ if (rw)
+ ipo->ddir = DDIR_WRITE;
+ else
+ ipo->ddir = DDIR_READ;
+
+ list_add_tail(&ipo->list, &td->io_log_list);
+}
+
+/*
+ * We only care for queue traces, most of the others are side effects
+ * due to internal workings of the block layer.
+ */
+static void handle_trace(struct thread_data *td, struct blk_io_trace *t,
+ unsigned long long ttime, unsigned long *ios)