+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
+DECLARE_EVENT_CLASS(block_bio_merge,
+
+ TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
+
+ TP_ARGS(q, rq, bio),
+
+ TP_STRUCT__entry(
+ __field( dev_t, dev )
+ __field( sector_t, sector )
+ __field( unsigned int, nr_sector )
+ __field( unsigned int, rwbs )
+ __field( pid_t, tid )
+ __array_text( char, comm, TASK_COMM_LEN )
+ ),
+
+ TP_fast_assign(
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
+ tp_assign(dev, bio->bi_bdev->bd_dev)
+ tp_assign(sector, bio->bi_iter.bi_sector)
+ tp_assign(nr_sector, bio_sectors(bio))
+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
+ tp_memcpy(comm, current->comm, TASK_COMM_LEN)
+ tp_assign(tid, current->pid)
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
+ tp_assign(dev, bio->bi_bdev->bd_dev)
+ tp_assign(sector, bio->bi_sector)
+ tp_assign(nr_sector, bio->bi_size >> 9)
+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
+ tp_memcpy(comm, current->comm, TASK_COMM_LEN)
+ tp_assign(tid, current->pid)
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
+ ),
+
+ TP_printk("%d,%d %s %llu + %u [%s] %d",
+ MAJOR(__entry->dev), MINOR(__entry->dev),
+ __print_rwbs_flags(__entry->rwbs),
+ (unsigned long long)__entry->sector,
+ __entry->nr_sector, __entry->comm, __entry->tid)
+)
+
+/**
+ * block_bio_backmerge - merging block operation to the end of an existing operation
+ * @q: queue holding operation
+ * @bio: new block operation to merge
+ *
+ * Merging block request @bio to the end of an existing block request
+ * in queue @q.
+ */
+DEFINE_EVENT(block_bio_merge, block_bio_backmerge,
+
+ TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
+
+ TP_ARGS(q, rq, bio)
+)
+
+/**
+ * block_bio_frontmerge - merging block operation to the beginning of an existing operation
+ * @q: queue holding operation
+ * @bio: new block operation to merge
+ *
+ * Merging block IO operation @bio to the beginning of an existing block
+ * operation in queue @q.
+ */
+DEFINE_EVENT(block_bio_merge, block_bio_frontmerge,
+
+ TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
+
+ TP_ARGS(q, rq, bio)
+)
+
+/**
+ * block_bio_queue - putting new block IO operation in queue
+ * @q: queue holding operation
+ * @bio: new block operation
+ *
+ * About to place the block IO operation @bio into queue @q.
+ */
+TRACE_EVENT(block_bio_queue,