Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] [PATCH lttng-modules 1/3] Fix: update block instrumentation for kernel 4.14
@ 2017-09-20 16:12 Michael Jeanson
  2017-09-20 16:12 ` [lttng-dev] [PATCH lttng-modules 2/3] Fix: update writeback " Michael Jeanson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Jeanson @ 2017-09-20 16:12 UTC (permalink / raw)


See upstream commit:

  commit 74d46992e0d9dee7f1f376de0d56d31614c8a17a
  Author: Christoph Hellwig <hch at lst.de>
  Date:   Wed Aug 23 19:10:32 2017 +0200

    block: replace bi_bdev with a gendisk pointer and partitions index

    This way we don't need a block_device structure to submit I/O.  The
    block_device has different life time rules from the gendisk and
    request_queue and is usually only available when the block device node
    is open.  Other callers need to explicitly create one (e.g. the lightnvm
    passthrough code, or the new nvme multipathing code).

    For the actual I/O path all that we need is the gendisk, which exists
    once per block device.  But given that the block layer also does
    partition remapping we additionally need a partition index, which is
    used for said remapping in generic_make_request.

    Note that all the block drivers generally want request_queue or
    sometimes the gendisk, so this removes a layer of indirection all
    over the stack.

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 instrumentation/events/lttng-module/block.h | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/instrumentation/events/lttng-module/block.h b/instrumentation/events/lttng-module/block.h
index c43d747..80ea25c 100644
--- a/instrumentation/events/lttng-module/block.h
+++ b/instrumentation/events/lttng-module/block.h
@@ -33,6 +33,13 @@ enum {
 
 #endif /* _TRACE_BLOCK_DEF_ */
 
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
+#define lttng_bio_dev(bio) bio_dev(bio)
+#else
+#define lttng_bio_dev(bio) ((bio)->bi_bdev ? (bio)->bi_bdev->bd_dev : 0)
+#endif
+
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
 
 #define lttng_req_op(rq)	req_op(rq)
@@ -611,7 +618,7 @@ LTTNG_TRACEPOINT_EVENT(block_bio_bounce,
 	TP_ARGS(q, bio),
 
 	TP_FIELDS(
-		ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0)
+		ctf_integer(dev_t, dev, lttng_bio_dev(bio))
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
 		ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
 		ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
@@ -652,7 +659,7 @@ LTTNG_TRACEPOINT_EVENT(block_bio_complete,
 #endif
 
 	TP_FIELDS(
-		ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
+		ctf_integer(dev_t, dev, lttng_bio_dev(bio))
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
 		ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
 		ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
@@ -682,7 +689,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge,
 	TP_ARGS(q, rq, bio),
 
 	TP_FIELDS(
-		ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
+		ctf_integer(dev_t, dev, lttng_bio_dev(bio))
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
 		ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
 		ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
@@ -744,7 +751,7 @@ LTTNG_TRACEPOINT_EVENT(block_bio_queue,
 	TP_ARGS(q, bio),
 
 	TP_FIELDS(
-		ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
+		ctf_integer(dev_t, dev, lttng_bio_dev(bio))
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
 		ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
 		ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
@@ -769,7 +776,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(block_bio,
 	TP_ARGS(q, bio),
 
 	TP_FIELDS(
-		ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0)
+		ctf_integer(dev_t, dev, lttng_bio_dev(bio))
 		ctf_integer(sector_t, sector, bio->bi_sector)
 		ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
 		blk_rwbs_ctf_integer(unsigned int, rwbs,
@@ -831,7 +838,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(block_get_rq,
 	TP_ARGS(q, bio, rw),
 
 	TP_FIELDS(
-		ctf_integer(dev_t, dev, bio ? bio->bi_bdev->bd_dev : 0)
+		ctf_integer(dev_t, dev, lttng_bio_dev(bio))
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
 		ctf_integer(sector_t, sector, bio ? bio->bi_iter.bi_sector : 0)
 		ctf_integer(unsigned int, nr_sector,
@@ -992,7 +999,7 @@ LTTNG_TRACEPOINT_EVENT(block_split,
 	TP_ARGS(q, bio, new_sector),
 
 	TP_FIELDS(
-		ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
+		ctf_integer(dev_t, dev, lttng_bio_dev(bio))
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
 		ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
 		blk_rwbs_ctf_integer(unsigned int, rwbs,
@@ -1031,7 +1038,7 @@ LTTNG_TRACEPOINT_EVENT(block_remap,
 	TP_ARGS(q, bio, dev, from),
 
 	TP_FIELDS(
-		ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
+		ctf_integer(dev_t, dev, lttng_bio_dev(bio))
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
 		ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
 		ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
-- 
2.7.4



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-29 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-20 16:12 [lttng-dev] [PATCH lttng-modules 1/3] Fix: update block instrumentation for kernel 4.14 Michael Jeanson
2017-09-20 16:12 ` [lttng-dev] [PATCH lttng-modules 2/3] Fix: update writeback " Michael Jeanson
2017-09-20 16:12 ` [lttng-dev] [PATCH lttng-modules 3/3] Fix: update btrfs " Michael Jeanson
2017-09-29 20:20 ` [lttng-dev] [PATCH lttng-modules 1/3] Fix: update block " Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox