Skip to contentSkip to conversation

nvme: trace bio completion

PATCH New Hannes Reinecke 2 participants 3 messages Jul 24, 2019 – Aug 1, 2019 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: trace bio completion

When native multipathing is enabled we cannot enable blktrace for the underlying paths, so any completion is never traced.

Signed-off-by Hannes Reinecke <hare at suse.com>
---
 drivers/nvme/host/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/nvme/host/core.c +6 -0
index 8f3fbe5ca937..ba5a23475314 100644
@@ -22,6 +22,8 @@
 #include <linux/pm_qos.h>
 #include <asm/unaligned.h>
 
+#include <trace/events/block.h>
+
 #define CREATE_TRACE_POINTS
 #include "trace.h"
 
@@ -261,6 +263,7 @@ static void nvme_retry_req(struct request *req)
 void nvme_complete_rq(struct request *req)
 {
 	blk_status_t status = nvme_error_status(req);
+	struct nvme_ns *ns = req->q->queuedata;
 
 	trace_nvme_complete_rq(req);
 
@@ -279,6 +282,9 @@ void nvme_complete_rq(struct request *req)
 			return;
 		}
 	}
+	if (req->bio && ns && ns->head->disk)
+		trace_block_bio_complete(ns->head->disk->queue,
+					 req->bio, status);
 	blk_mq_end_request(req, status);
 }
 EXPORT_SYMBOL_GPL(nvme_complete_rq);
Signature · 1 line
2.16.4
maintainer
#1 lore raw

PATCH 1/1 nvme: trace bio completion

Reviewed-by Sagi Grimberg <sagi at grimberg.me>