All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] nvme: add set feature tracing support
@ 2021-07-05 11:28 Hou Pu
  2021-07-05 11:28 ` [PATCH v2 1/3] nvme: unify trace output of nvmet_trace_admin_get_features Hou Pu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hou Pu @ 2021-07-05 11:28 UTC (permalink / raw)
  To: sagi, hch, chaitanya.kulkarni, maxg; +Cc: linux-nvme, houpu.main

Add set feature tracing support to host and controller side.
Also fix a style problem in nvmet_trace_admin_get_features.

Changes compared to v1:
* The output style fix is extracted to a separate patch.
* cdw11-cdw15 is keeped in the output. All suggested by Max Gurtovoy.


Hou Pu (2):
  nvme: add set feature tracing support
  nvmet: add set feature tracing support

 drivers/nvme/host/trace.c   | 16 ++++++++++++++++
 drivers/nvme/target/trace.c | 16 ++++++++++++++++
 2 files changed, 32 insertions(+)

-- 
2.28.0


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* [PATCH v2 1/3] nvme: unify trace output of nvmet_trace_admin_get_features
  2021-07-05 11:28 [PATCH v2 0/2] nvme: add set feature tracing support Hou Pu
@ 2021-07-05 11:28 ` Hou Pu
  2021-07-05 11:28 ` [PATCH v2 2/3] nvme: add set feature tracing support Hou Pu
  2021-07-05 11:28 ` [PATCH v2 3/3] nvmet: " Hou Pu
  2 siblings, 0 replies; 4+ messages in thread
From: Hou Pu @ 2021-07-05 11:28 UTC (permalink / raw)
  To: sagi, hch, chaitanya.kulkarni, maxg; +Cc: linux-nvme, houpu.main

Using ',' to separate different field like others in
nvmet_trace_admin_get_features. Also ouput uuid_index
in cdw14.

For example:
nvme get-feature -n 1 /dev/nvme0 -f 0xf

kworker/0:1H-56      [000] ....   283.696969: nvmet_req_init: nvmet1: qid=0, cmdid=21, nsid=1, flags=0x40, meta=0x0, cmd=(nvme_admin_get_features, fid=0xf, sel=0x0, cdw11=0x0, uuid_index=0x0)

Signed-off-by: Hou Pu <houpu.main@gmail.com>
---
 drivers/nvme/host/trace.c   | 4 +++-
 drivers/nvme/target/trace.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/trace.c b/drivers/nvme/host/trace.c
index 6543015b6121..0e441bdad453 100644
--- a/drivers/nvme/host/trace.c
+++ b/drivers/nvme/host/trace.c
@@ -79,8 +79,10 @@ static const char *nvme_trace_admin_get_features(struct trace_seq *p,
 	u8 fid = cdw10[0];
 	u8 sel = cdw10[1] & 0x7;
 	u32 cdw11 = get_unaligned_le32(cdw10 + 4);
+	u8 uuid_index = cdw10[16] & 0x7f;
 
-	trace_seq_printf(p, "fid=0x%x sel=0x%x cdw11=0x%x", fid, sel, cdw11);
+	trace_seq_printf(p, "fid=0x%x, sel=0x%x, cdw11=0x%x, uuid_index=0x%x",
+			 fid, sel, cdw11, uuid_index);
 	trace_seq_putc(p, 0);
 
 	return ret;
diff --git a/drivers/nvme/target/trace.c b/drivers/nvme/target/trace.c
index 1373a3c67962..902500a57185 100644
--- a/drivers/nvme/target/trace.c
+++ b/drivers/nvme/target/trace.c
@@ -26,8 +26,10 @@ static const char *nvmet_trace_admin_get_features(struct trace_seq *p,
 	u8 fid = cdw10[0];
 	u8 sel = cdw10[1] & 0x7;
 	u32 cdw11 = get_unaligned_le32(cdw10 + 4);
+	u8 uuid_index = cdw10[16] & 0x7f;
 
-	trace_seq_printf(p, "fid=0x%x sel=0x%x cdw11=0x%x", fid, sel, cdw11);
+	trace_seq_printf(p, "fid=0x%x, sel=0x%x, cdw11=0x%x, uuid_index=0x%x",
+			 fid, sel, cdw11, uuid_index);
 	trace_seq_putc(p, 0);
 
 	return ret;
-- 
2.28.0


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* [PATCH v2 2/3] nvme: add set feature tracing support
  2021-07-05 11:28 [PATCH v2 0/2] nvme: add set feature tracing support Hou Pu
  2021-07-05 11:28 ` [PATCH v2 1/3] nvme: unify trace output of nvmet_trace_admin_get_features Hou Pu
@ 2021-07-05 11:28 ` Hou Pu
  2021-07-05 11:28 ` [PATCH v2 3/3] nvmet: " Hou Pu
  2 siblings, 0 replies; 4+ messages in thread
From: Hou Pu @ 2021-07-05 11:28 UTC (permalink / raw)
  To: sagi, hch, chaitanya.kulkarni, maxg; +Cc: linux-nvme, houpu.main

A nvme connect command produces following trace.

Before:
    kworker/5:1H-98      [005] ....  3221.294844: nvme_setup_cmd: nvme0: qid=0, cmdid=25, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features cdw10=07 00 00 00 07 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)
    kworker/4:1H-124     [004] ....  3222.009186: nvme_setup_cmd: nvme0: qid=0, cmdid=17, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features cdw10=0b 00 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)

After:
    kworker/2:1H-107     [002] ....    88.541485: nvme_setup_cmd: nvme0: qid=0, cmdid=6, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features fid=0x7, sv=0x0, cdw11=07 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)
    kworker/2:1H-107     [002] ....    89.259507: nvme_setup_cmd: nvme0: qid=0, cmdid=7, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features fid=0xb, sv=0x0, cdw11=00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)

Signed-off-by: Hou Pu <houpu.main@gmail.com>
---
 drivers/nvme/host/trace.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/nvme/host/trace.c b/drivers/nvme/host/trace.c
index 0e441bdad453..681ad2c930c0 100644
--- a/drivers/nvme/host/trace.c
+++ b/drivers/nvme/host/trace.c
@@ -72,6 +72,20 @@ static const char *nvme_trace_admin_identify(struct trace_seq *p, u8 *cdw10)
 	return ret;
 }
 
+static const char *nvme_trace_admin_set_features(struct trace_seq *p,
+						 u8 *cdw10)
+{
+	const char *ret = trace_seq_buffer_ptr(p);
+	u8 fid = cdw10[0];
+	u8 sv = cdw10[3] & 0x8;
+
+	trace_seq_printf(p, "fid=0x%x, sv=0x%x, ", fid, sv);
+	trace_seq_printf(p, "cdw11=%*ph", 20, cdw10 + 4);
+	trace_seq_putc(p, 0);
+
+	return ret;
+}
+
 static const char *nvme_trace_admin_get_features(struct trace_seq *p,
 						 u8 *cdw10)
 {
@@ -203,6 +217,8 @@ const char *nvme_trace_parse_admin_cmd(struct trace_seq *p,
 		return nvme_trace_create_cq(p, cdw10);
 	case nvme_admin_identify:
 		return nvme_trace_admin_identify(p, cdw10);
+	case nvme_admin_set_features:
+		return nvme_trace_admin_set_features(p, cdw10);
 	case nvme_admin_get_features:
 		return nvme_trace_admin_get_features(p, cdw10);
 	case nvme_admin_get_lba_status:
-- 
2.28.0


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* [PATCH v2 3/3] nvmet: add set feature tracing support
  2021-07-05 11:28 [PATCH v2 0/2] nvme: add set feature tracing support Hou Pu
  2021-07-05 11:28 ` [PATCH v2 1/3] nvme: unify trace output of nvmet_trace_admin_get_features Hou Pu
  2021-07-05 11:28 ` [PATCH v2 2/3] nvme: add set feature tracing support Hou Pu
@ 2021-07-05 11:28 ` Hou Pu
  2 siblings, 0 replies; 4+ messages in thread
From: Hou Pu @ 2021-07-05 11:28 UTC (permalink / raw)
  To: sagi, hch, chaitanya.kulkarni, maxg; +Cc: linux-nvme, houpu.main

A nvme connect command produces following trace from the target side.

Before:
    kworker/0:1H-56      [000] ....  9012.155139: nvmet_req_init: nvmet1: qid=0, cmdid=16, nsid=0, flags=0x40, meta=0x0, cmd=(nvme_admin_set_features, cdw10=07 00 00 00 07 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)
    kworker/0:1H-56      [000] ....  9012.872272: nvmet_req_init: nvmet1: qid=0, cmdid=13, nsid=0, flags=0x40, meta=0x0, cmd=(nvme_admin_set_features, cdw10=0b 00 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)

After:
    kworker/0:1H-56      [000] ....    97.207441: nvmet_req_init: nvmet1: qid=0, cmdid=6, nsid=0, flags=0x40, meta=0x0, cmd=(nvme_admin_set_features, fid=0x7, sv=0x0, cdw11=07 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)
    kworker/0:1H-56      [000] ....    97.925443: nvmet_req_init: nvmet1: qid=0, cmdid=7, nsid=0, flags=0x40, meta=0x0, cmd=(nvme_admin_set_features, fid=0xb, sv=0x0, cdw11=00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)

Signed-off-by: Hou Pu <houpu.main@gmail.com>
---
 drivers/nvme/target/trace.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/nvme/target/trace.c b/drivers/nvme/target/trace.c
index 902500a57185..a1200837646a 100644
--- a/drivers/nvme/target/trace.c
+++ b/drivers/nvme/target/trace.c
@@ -19,6 +19,20 @@ static const char *nvmet_trace_admin_identify(struct trace_seq *p, u8 *cdw10)
 	return ret;
 }
 
+static const char *nvmet_trace_admin_set_features(struct trace_seq *p,
+						 u8 *cdw10)
+{
+	const char *ret = trace_seq_buffer_ptr(p);
+	u8 fid = cdw10[0];
+	u8 sv = cdw10[3] & 0x8;
+
+	trace_seq_printf(p, "fid=0x%x, sv=0x%x, ", fid, sv);
+	trace_seq_printf(p, "cdw11=%*ph", 20, cdw10 + 4);
+	trace_seq_putc(p, 0);
+
+	return ret;
+}
+
 static const char *nvmet_trace_admin_get_features(struct trace_seq *p,
 						 u8 *cdw10)
 {
@@ -96,6 +110,8 @@ const char *nvmet_trace_parse_admin_cmd(struct trace_seq *p,
 	switch (opcode) {
 	case nvme_admin_identify:
 		return nvmet_trace_admin_identify(p, cdw10);
+	case nvme_admin_set_features:
+		return nvmet_trace_admin_set_features(p, cdw10);
 	case nvme_admin_get_features:
 		return nvmet_trace_admin_get_features(p, cdw10);
 	case nvme_admin_get_lba_status:
-- 
2.28.0


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, other threads:[~2021-07-05 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 11:28 [PATCH v2 0/2] nvme: add set feature tracing support Hou Pu
2021-07-05 11:28 ` [PATCH v2 1/3] nvme: unify trace output of nvmet_trace_admin_get_features Hou Pu
2021-07-05 11:28 ` [PATCH v2 2/3] nvme: add set feature tracing support Hou Pu
2021-07-05 11:28 ` [PATCH v2 3/3] nvmet: " Hou Pu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.