+ handle_trace_fs(td, t, delay, ios, bs);
+}
+
+static void byteswap_trace(struct blk_io_trace *t)
+{
+ t->magic = fio_swap32(t->magic);
+ t->sequence = fio_swap32(t->sequence);
+ t->time = fio_swap64(t->time);
+ t->sector = fio_swap64(t->sector);
+ t->bytes = fio_swap32(t->bytes);
+ t->action = fio_swap32(t->action);
+ t->pid = fio_swap32(t->pid);
+ t->device = fio_swap32(t->device);
+ t->cpu = fio_swap32(t->cpu);
+ t->error = fio_swap16(t->error);
+ t->pdu_len = fio_swap16(t->pdu_len);
+}
+
+static int t_is_write(struct blk_io_trace *t)
+{
+ return (t->action & BLK_TC_ACT(BLK_TC_WRITE | BLK_TC_DISCARD)) != 0;
+}
+
+static enum fio_ddir t_get_ddir(struct blk_io_trace *t)
+{
+ if (t->action & BLK_TC_ACT(BLK_TC_READ))
+ return DDIR_READ;
+ else if (t->action & BLK_TC_ACT(BLK_TC_WRITE))
+ return DDIR_WRITE;
+ else if (t->action & BLK_TC_ACT(BLK_TC_DISCARD))
+ return DDIR_TRIM;
+
+ return DDIR_INVAL;
+}
+
+static void depth_inc(struct blk_io_trace *t, int *depth)
+{
+ enum fio_ddir ddir;
+
+ ddir = t_get_ddir(t);
+ if (ddir != DDIR_INVAL)
+ depth[ddir]++;
+}
+
+static void depth_dec(struct blk_io_trace *t, int *depth)
+{
+ enum fio_ddir ddir;
+
+ ddir = t_get_ddir(t);
+ if (ddir != DDIR_INVAL)
+ depth[ddir]--;
+}
+
+static void depth_end(struct blk_io_trace *t, int *this_depth, int *depth)
+{
+ enum fio_ddir ddir = DDIR_INVAL;
+
+ ddir = t_get_ddir(t);
+ if (ddir != DDIR_INVAL) {
+ depth[ddir] = max(depth[ddir], this_depth[ddir]);
+ this_depth[ddir] = 0;
+ }