All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: add tracing of zns commands
@ 2021-01-26 17:50 ` Johannes Thumshirn
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2021-01-26 17:50 UTC (permalink / raw)
  To: Keith Busch, Christoph Hellwig, Sagi Grimberg
  Cc: linux-nvme, linux-block, Johannes Thumshirn

When support for the NVMe ZNS commands was merged, tracing of these has
been omitted.

Add nvme_cmd_zone_mgmt_send, nvme_cmd_zone_mgmt_recv as well as
nvme_cmd_zone_append to the nvme driver's tracing facility.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 drivers/nvme/host/trace.c | 34 ++++++++++++++++++++++++++++++++++
 include/linux/nvme.h      |  6 +++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/trace.c b/drivers/nvme/host/trace.c
index 5c3cb6928f3c..9f9b6108de7d 100644
--- a/drivers/nvme/host/trace.c
+++ b/drivers/nvme/host/trace.c
@@ -131,6 +131,35 @@ static const char *nvme_trace_dsm(struct trace_seq *p, u8 *cdw10)
 	return ret;
 }
 
+static const char *nvme_trace_zone_mgmt_send(struct trace_seq *p, u8 *cdw10)
+{
+	const char *ret = trace_seq_buffer_ptr(p);
+	u64 slba = get_unaligned_le64(cdw10);
+	u8 zsa = cdw10[12];
+	u8 all = cdw10[13];
+
+	trace_seq_printf(p, "slba=%llu, zsa=%u, all=%u", slba, zsa, all);
+	trace_seq_putc(p, 0);
+
+	return ret;
+}
+
+static const char *nvme_trace_zone_mgmt_recv(struct trace_seq *p, u8 *cdw10)
+{
+	const char *ret = trace_seq_buffer_ptr(p);
+	u64 slba = get_unaligned_le64(cdw10);
+	u32 numd = get_unaligned_le32(cdw10 + 8);
+	u8 zra = cdw10[12];
+	u8 zrasf = cdw10[13];
+	u8 pr = cdw10[14];
+
+	trace_seq_printf(p, "slba=%llu, numd=%u, zra=%u, zrasf=%u, pr=%u",
+			 slba, numd, zra, zrasf, pr);
+	trace_seq_putc(p, 0);
+
+	return ret;
+}
+
 static const char *nvme_trace_common(struct trace_seq *p, u8 *cdw10)
 {
 	const char *ret = trace_seq_buffer_ptr(p);
@@ -171,9 +200,14 @@ const char *nvme_trace_parse_nvm_cmd(struct trace_seq *p,
 	case nvme_cmd_read:
 	case nvme_cmd_write:
 	case nvme_cmd_write_zeroes:
+	case nvme_cmd_zone_append:
 		return nvme_trace_read_write(p, cdw10);
 	case nvme_cmd_dsm:
 		return nvme_trace_dsm(p, cdw10);
+	case nvme_cmd_zone_mgmt_send:
+		return nvme_trace_zone_mgmt_send(p, cdw10);
+	case nvme_cmd_zone_mgmt_recv:
+		return nvme_trace_zone_mgmt_recv(p, cdw10);
 	default:
 		return nvme_trace_common(p, cdw10);
 	}
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index bfed36e342cc..325dcdd221de 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -697,7 +697,11 @@ enum nvme_opcode {
 		nvme_opcode_name(nvme_cmd_resv_register),	\
 		nvme_opcode_name(nvme_cmd_resv_report),		\
 		nvme_opcode_name(nvme_cmd_resv_acquire),	\
-		nvme_opcode_name(nvme_cmd_resv_release))
+		nvme_opcode_name(nvme_cmd_resv_release),	\
+		nvme_opcode_name(nvme_cmd_zone_mgmt_send),	\
+		nvme_opcode_name(nvme_cmd_zone_mgmt_recv),	\
+		nvme_opcode_name(nvme_cmd_zone_append))
+
 
 
 /*
-- 
2.26.2


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

* [PATCH] nvme: add tracing of zns commands
@ 2021-01-26 17:50 ` Johannes Thumshirn
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2021-01-26 17:50 UTC (permalink / raw)
  To: Keith Busch, Christoph Hellwig, Sagi Grimberg
  Cc: linux-block, Johannes Thumshirn, linux-nvme

When support for the NVMe ZNS commands was merged, tracing of these has
been omitted.

Add nvme_cmd_zone_mgmt_send, nvme_cmd_zone_mgmt_recv as well as
nvme_cmd_zone_append to the nvme driver's tracing facility.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 drivers/nvme/host/trace.c | 34 ++++++++++++++++++++++++++++++++++
 include/linux/nvme.h      |  6 +++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/trace.c b/drivers/nvme/host/trace.c
index 5c3cb6928f3c..9f9b6108de7d 100644
--- a/drivers/nvme/host/trace.c
+++ b/drivers/nvme/host/trace.c
@@ -131,6 +131,35 @@ static const char *nvme_trace_dsm(struct trace_seq *p, u8 *cdw10)
 	return ret;
 }
 
+static const char *nvme_trace_zone_mgmt_send(struct trace_seq *p, u8 *cdw10)
+{
+	const char *ret = trace_seq_buffer_ptr(p);
+	u64 slba = get_unaligned_le64(cdw10);
+	u8 zsa = cdw10[12];
+	u8 all = cdw10[13];
+
+	trace_seq_printf(p, "slba=%llu, zsa=%u, all=%u", slba, zsa, all);
+	trace_seq_putc(p, 0);
+
+	return ret;
+}
+
+static const char *nvme_trace_zone_mgmt_recv(struct trace_seq *p, u8 *cdw10)
+{
+	const char *ret = trace_seq_buffer_ptr(p);
+	u64 slba = get_unaligned_le64(cdw10);
+	u32 numd = get_unaligned_le32(cdw10 + 8);
+	u8 zra = cdw10[12];
+	u8 zrasf = cdw10[13];
+	u8 pr = cdw10[14];
+
+	trace_seq_printf(p, "slba=%llu, numd=%u, zra=%u, zrasf=%u, pr=%u",
+			 slba, numd, zra, zrasf, pr);
+	trace_seq_putc(p, 0);
+
+	return ret;
+}
+
 static const char *nvme_trace_common(struct trace_seq *p, u8 *cdw10)
 {
 	const char *ret = trace_seq_buffer_ptr(p);
@@ -171,9 +200,14 @@ const char *nvme_trace_parse_nvm_cmd(struct trace_seq *p,
 	case nvme_cmd_read:
 	case nvme_cmd_write:
 	case nvme_cmd_write_zeroes:
+	case nvme_cmd_zone_append:
 		return nvme_trace_read_write(p, cdw10);
 	case nvme_cmd_dsm:
 		return nvme_trace_dsm(p, cdw10);
+	case nvme_cmd_zone_mgmt_send:
+		return nvme_trace_zone_mgmt_send(p, cdw10);
+	case nvme_cmd_zone_mgmt_recv:
+		return nvme_trace_zone_mgmt_recv(p, cdw10);
 	default:
 		return nvme_trace_common(p, cdw10);
 	}
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index bfed36e342cc..325dcdd221de 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -697,7 +697,11 @@ enum nvme_opcode {
 		nvme_opcode_name(nvme_cmd_resv_register),	\
 		nvme_opcode_name(nvme_cmd_resv_report),		\
 		nvme_opcode_name(nvme_cmd_resv_acquire),	\
-		nvme_opcode_name(nvme_cmd_resv_release))
+		nvme_opcode_name(nvme_cmd_resv_release),	\
+		nvme_opcode_name(nvme_cmd_zone_mgmt_send),	\
+		nvme_opcode_name(nvme_cmd_zone_mgmt_recv),	\
+		nvme_opcode_name(nvme_cmd_zone_append))
+
 
 
 /*
-- 
2.26.2


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

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

* Re: [PATCH] nvme: add tracing of zns commands
  2021-01-26 17:50 ` Johannes Thumshirn
@ 2021-01-27 17:46   ` Christoph Hellwig
  -1 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-01-27 17:46 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: Keith Busch, Christoph Hellwig, Sagi Grimberg, linux-nvme, linux-block

Thanks,

applied to nvme-5.12.

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

* Re: [PATCH] nvme: add tracing of zns commands
@ 2021-01-27 17:46   ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-01-27 17:46 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: Keith Busch, linux-block, Christoph Hellwig, linux-nvme, Sagi Grimberg

Thanks,

applied to nvme-5.12.

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

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

* Re: [PATCH] nvme: add tracing of zns commands
  2021-01-26 17:50 ` Johannes Thumshirn
@ 2021-01-29  3:48   ` Damien Le Moal
  -1 siblings, 0 replies; 6+ messages in thread
From: Damien Le Moal @ 2021-01-29  3:48 UTC (permalink / raw)
  To: Johannes Thumshirn, Keith Busch, Christoph Hellwig, Sagi Grimberg
  Cc: linux-nvme, linux-block

On 2021/01/27 7:14, Johannes Thumshirn wrote:
> When support for the NVMe ZNS commands was merged, tracing of these has
> been omitted.
> 
> Add nvme_cmd_zone_mgmt_send, nvme_cmd_zone_mgmt_recv as well as
> nvme_cmd_zone_append to the nvme driver's tracing facility.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  drivers/nvme/host/trace.c | 34 ++++++++++++++++++++++++++++++++++
>  include/linux/nvme.h      |  6 +++++-
>  2 files changed, 39 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/trace.c b/drivers/nvme/host/trace.c
> index 5c3cb6928f3c..9f9b6108de7d 100644
> --- a/drivers/nvme/host/trace.c
> +++ b/drivers/nvme/host/trace.c
> @@ -131,6 +131,35 @@ static const char *nvme_trace_dsm(struct trace_seq *p, u8 *cdw10)
>  	return ret;
>  }
>  
> +static const char *nvme_trace_zone_mgmt_send(struct trace_seq *p, u8 *cdw10)
> +{
> +	const char *ret = trace_seq_buffer_ptr(p);
> +	u64 slba = get_unaligned_le64(cdw10);
> +	u8 zsa = cdw10[12];
> +	u8 all = cdw10[13];
> +
> +	trace_seq_printf(p, "slba=%llu, zsa=%u, all=%u", slba, zsa, all);
> +	trace_seq_putc(p, 0);
> +
> +	return ret;
> +}
> +
> +static const char *nvme_trace_zone_mgmt_recv(struct trace_seq *p, u8 *cdw10)
> +{
> +	const char *ret = trace_seq_buffer_ptr(p);
> +	u64 slba = get_unaligned_le64(cdw10);
> +	u32 numd = get_unaligned_le32(cdw10 + 8);
> +	u8 zra = cdw10[12];
> +	u8 zrasf = cdw10[13];
> +	u8 pr = cdw10[14];
> +
> +	trace_seq_printf(p, "slba=%llu, numd=%u, zra=%u, zrasf=%u, pr=%u",
> +			 slba, numd, zra, zrasf, pr);
> +	trace_seq_putc(p, 0);
> +
> +	return ret;
> +}
> +
>  static const char *nvme_trace_common(struct trace_seq *p, u8 *cdw10)
>  {
>  	const char *ret = trace_seq_buffer_ptr(p);
> @@ -171,9 +200,14 @@ const char *nvme_trace_parse_nvm_cmd(struct trace_seq *p,
>  	case nvme_cmd_read:
>  	case nvme_cmd_write:
>  	case nvme_cmd_write_zeroes:
> +	case nvme_cmd_zone_append:
>  		return nvme_trace_read_write(p, cdw10);
>  	case nvme_cmd_dsm:
>  		return nvme_trace_dsm(p, cdw10);
> +	case nvme_cmd_zone_mgmt_send:
> +		return nvme_trace_zone_mgmt_send(p, cdw10);
> +	case nvme_cmd_zone_mgmt_recv:
> +		return nvme_trace_zone_mgmt_recv(p, cdw10);
>  	default:
>  		return nvme_trace_common(p, cdw10);
>  	}
> diff --git a/include/linux/nvme.h b/include/linux/nvme.h
> index bfed36e342cc..325dcdd221de 100644
> --- a/include/linux/nvme.h
> +++ b/include/linux/nvme.h
> @@ -697,7 +697,11 @@ enum nvme_opcode {
>  		nvme_opcode_name(nvme_cmd_resv_register),	\
>  		nvme_opcode_name(nvme_cmd_resv_report),		\
>  		nvme_opcode_name(nvme_cmd_resv_acquire),	\
> -		nvme_opcode_name(nvme_cmd_resv_release))
> +		nvme_opcode_name(nvme_cmd_resv_release),	\
> +		nvme_opcode_name(nvme_cmd_zone_mgmt_send),	\
> +		nvme_opcode_name(nvme_cmd_zone_mgmt_recv),	\
> +		nvme_opcode_name(nvme_cmd_zone_append))
> +
>  
>  
>  /*
> 

Looks OK to me.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH] nvme: add tracing of zns commands
@ 2021-01-29  3:48   ` Damien Le Moal
  0 siblings, 0 replies; 6+ messages in thread
From: Damien Le Moal @ 2021-01-29  3:48 UTC (permalink / raw)
  To: Johannes Thumshirn, Keith Busch, Christoph Hellwig, Sagi Grimberg
  Cc: linux-block, linux-nvme

On 2021/01/27 7:14, Johannes Thumshirn wrote:
> When support for the NVMe ZNS commands was merged, tracing of these has
> been omitted.
> 
> Add nvme_cmd_zone_mgmt_send, nvme_cmd_zone_mgmt_recv as well as
> nvme_cmd_zone_append to the nvme driver's tracing facility.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  drivers/nvme/host/trace.c | 34 ++++++++++++++++++++++++++++++++++
>  include/linux/nvme.h      |  6 +++++-
>  2 files changed, 39 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/trace.c b/drivers/nvme/host/trace.c
> index 5c3cb6928f3c..9f9b6108de7d 100644
> --- a/drivers/nvme/host/trace.c
> +++ b/drivers/nvme/host/trace.c
> @@ -131,6 +131,35 @@ static const char *nvme_trace_dsm(struct trace_seq *p, u8 *cdw10)
>  	return ret;
>  }
>  
> +static const char *nvme_trace_zone_mgmt_send(struct trace_seq *p, u8 *cdw10)
> +{
> +	const char *ret = trace_seq_buffer_ptr(p);
> +	u64 slba = get_unaligned_le64(cdw10);
> +	u8 zsa = cdw10[12];
> +	u8 all = cdw10[13];
> +
> +	trace_seq_printf(p, "slba=%llu, zsa=%u, all=%u", slba, zsa, all);
> +	trace_seq_putc(p, 0);
> +
> +	return ret;
> +}
> +
> +static const char *nvme_trace_zone_mgmt_recv(struct trace_seq *p, u8 *cdw10)
> +{
> +	const char *ret = trace_seq_buffer_ptr(p);
> +	u64 slba = get_unaligned_le64(cdw10);
> +	u32 numd = get_unaligned_le32(cdw10 + 8);
> +	u8 zra = cdw10[12];
> +	u8 zrasf = cdw10[13];
> +	u8 pr = cdw10[14];
> +
> +	trace_seq_printf(p, "slba=%llu, numd=%u, zra=%u, zrasf=%u, pr=%u",
> +			 slba, numd, zra, zrasf, pr);
> +	trace_seq_putc(p, 0);
> +
> +	return ret;
> +}
> +
>  static const char *nvme_trace_common(struct trace_seq *p, u8 *cdw10)
>  {
>  	const char *ret = trace_seq_buffer_ptr(p);
> @@ -171,9 +200,14 @@ const char *nvme_trace_parse_nvm_cmd(struct trace_seq *p,
>  	case nvme_cmd_read:
>  	case nvme_cmd_write:
>  	case nvme_cmd_write_zeroes:
> +	case nvme_cmd_zone_append:
>  		return nvme_trace_read_write(p, cdw10);
>  	case nvme_cmd_dsm:
>  		return nvme_trace_dsm(p, cdw10);
> +	case nvme_cmd_zone_mgmt_send:
> +		return nvme_trace_zone_mgmt_send(p, cdw10);
> +	case nvme_cmd_zone_mgmt_recv:
> +		return nvme_trace_zone_mgmt_recv(p, cdw10);
>  	default:
>  		return nvme_trace_common(p, cdw10);
>  	}
> diff --git a/include/linux/nvme.h b/include/linux/nvme.h
> index bfed36e342cc..325dcdd221de 100644
> --- a/include/linux/nvme.h
> +++ b/include/linux/nvme.h
> @@ -697,7 +697,11 @@ enum nvme_opcode {
>  		nvme_opcode_name(nvme_cmd_resv_register),	\
>  		nvme_opcode_name(nvme_cmd_resv_report),		\
>  		nvme_opcode_name(nvme_cmd_resv_acquire),	\
> -		nvme_opcode_name(nvme_cmd_resv_release))
> +		nvme_opcode_name(nvme_cmd_resv_release),	\
> +		nvme_opcode_name(nvme_cmd_zone_mgmt_send),	\
> +		nvme_opcode_name(nvme_cmd_zone_mgmt_recv),	\
> +		nvme_opcode_name(nvme_cmd_zone_append))
> +
>  
>  
>  /*
> 

Looks OK to me.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

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

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

end of thread, other threads:[~2021-01-29  3:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 17:50 [PATCH] nvme: add tracing of zns commands Johannes Thumshirn
2021-01-26 17:50 ` Johannes Thumshirn
2021-01-27 17:46 ` Christoph Hellwig
2021-01-27 17:46   ` Christoph Hellwig
2021-01-29  3:48 ` Damien Le Moal
2021-01-29  3:48   ` Damien Le Moal

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.