linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/2] share nvme trace event helper functions with other modules
@ 2018-12-17  8:06 yupeng
  2018-12-17  8:06 ` [PATCH v3 2/2] trace nvme submit queue status yupeng
  0 siblings, 1 reply; 4+ messages in thread
From: yupeng @ 2018-12-17  8:06 UTC (permalink / raw)
  To: linux-block, linux-kernel, linux-nvme, keith.busch, axboe, hch,
	sagi

Currently the trace.c/trace.h could only be used by nvme-core. This
patch moves __assign_disk_name to genhd.h, exports nvme_trace_disk_name to
other modules. Thus other nvme modules could also trace disk name.

Signed-off-by: yupeng <yupeng0921@gmail.com>
---
 drivers/nvme/host/trace.c |  2 ++
 drivers/nvme/host/trace.h | 10 ----------
 include/linux/genhd.h     |  8 ++++++++
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/nvme/host/trace.c b/drivers/nvme/host/trace.c
index 25b0e310f4a8..99a132a34403 100644
--- a/drivers/nvme/host/trace.c
+++ b/drivers/nvme/host/trace.c
@@ -139,3 +139,5 @@ const char *nvme_trace_disk_name(struct trace_seq *p, char *name)
 
 	return ret;
 }
+
+EXPORT_SYMBOL_GPL(nvme_trace_disk_name);
diff --git a/drivers/nvme/host/trace.h b/drivers/nvme/host/trace.h
index 196d5bd56718..23f3fcf04fb6 100644
--- a/drivers/nvme/host/trace.h
+++ b/drivers/nvme/host/trace.h
@@ -82,16 +82,6 @@ const char *nvme_trace_disk_name(struct trace_seq *p, char *name);
 #define __print_disk_name(name)				\
 	nvme_trace_disk_name(p, name)
 
-#ifndef TRACE_HEADER_MULTI_READ
-static inline void __assign_disk_name(char *name, struct gendisk *disk)
-{
-	if (disk)
-		memcpy(name, disk->disk_name, DISK_NAME_LEN);
-	else
-		memset(name, 0, DISK_NAME_LEN);
-}
-#endif
-
 TRACE_EVENT(nvme_setup_cmd,
 	    TP_PROTO(struct request *req, struct nvme_command *cmd),
 	    TP_ARGS(req, cmd),
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 70fc838e6773..468ab3143d77 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -749,6 +749,14 @@ static inline void blk_integrity_add(struct gendisk *disk) { }
 static inline void blk_integrity_del(struct gendisk *disk) { }
 #endif	/* CONFIG_BLK_DEV_INTEGRITY */
 
+static inline void __assign_disk_name(char *name, struct gendisk *disk)
+{
+	if (disk)
+		memcpy(name, disk->disk_name, DISK_NAME_LEN);
+	else
+		memset(name, 0, DISK_NAME_LEN);
+}
+
 #else /* CONFIG_BLOCK */
 
 static inline void printk_all_partitions(void) { }
-- 
2.17.1


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

end of thread, other threads:[~2018-12-17 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-17  8:06 [PATCH v3 1/2] share nvme trace event helper functions with other modules yupeng
2018-12-17  8:06 ` [PATCH v3 2/2] trace nvme submit queue status yupeng
2018-12-17  8:33   ` Johannes Thumshirn
2018-12-17 11:11     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).