- if ((t->action & 0xffff) != __BLK_TA_QUEUE)
- return;
- if (t->action & BLK_TC_ACT(BLK_TC_PC))
- return;
- if (t->action & BLK_TC_ACT(BLK_TC_NOTIFY))
- return;
+static void handle_trace_discard(struct thread_data *td, struct blk_io_trace *t,
+ unsigned long long ttime, unsigned long *ios)
+{
+ struct io_piece *ipo = malloc(sizeof(*ipo));
+
+ init_ipo(ipo);
+ trace_add_file(td, t->device);
+
+ ios[DDIR_WRITE]++;
+ td->o.size += t->bytes;
+
+ memset(ipo, 0, sizeof(*ipo));
+ INIT_FLIST_HEAD(&ipo->list);
+
+ /*
+ * the 512 is wrong here, it should be the hardware sector size...
+ */
+ ipo->offset = t->sector * 512;
+ ipo->len = t->bytes;
+ ipo->delay = ttime / 1000;
+ ipo->ddir = DDIR_TRIM;
+
+ dprint(FD_BLKTRACE, "store discard, off=%llu, len=%lu, delay=%lu\n",
+ ipo->offset, ipo->len,
+ ipo->delay);
+ queue_io_piece(td, ipo);
+}
+
+static void handle_trace_fs(struct thread_data *td, struct blk_io_trace *t,
+ unsigned long long ttime, unsigned long *ios,
+ unsigned int *bs)
+{
+ int rw;