Commit 6a0164f9 authored by Guixin Liu's avatar Guixin Liu Committed by Keith Busch

nvme: add tracing of reservation commands

Add detailed parsing of reservation commands to make the trace log
more consistent and human-readable.
Signed-off-by: default avatarGuixin Liu <kanie@linux.alibaba.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 8d539f75
......@@ -223,6 +223,60 @@ static const char *nvme_trace_zone_mgmt_recv(struct trace_seq *p, u8 *cdw10)
return ret;
}
static const char *nvme_trace_resv_reg(struct trace_seq *p, u8 *cdw10)
{
const char *ret = trace_seq_buffer_ptr(p);
u8 rrega = cdw10[0] & 0x7;
u8 iekey = (cdw10[0] >> 3) & 0x1;
u8 ptpl = (cdw10[3] >> 6) & 0x3;
trace_seq_printf(p, "rrega=%u, iekey=%u, ptpl=%u",
rrega, iekey, ptpl);
trace_seq_putc(p, 0);
return ret;
}
static const char *nvme_trace_resv_acq(struct trace_seq *p, u8 *cdw10)
{
const char *ret = trace_seq_buffer_ptr(p);
u8 racqa = cdw10[0] & 0x7;
u8 iekey = (cdw10[0] >> 3) & 0x1;
u8 rtype = cdw10[1];
trace_seq_printf(p, "racqa=%u, iekey=%u, rtype=%u",
racqa, iekey, rtype);
trace_seq_putc(p, 0);
return ret;
}
static const char *nvme_trace_resv_rel(struct trace_seq *p, u8 *cdw10)
{
const char *ret = trace_seq_buffer_ptr(p);
u8 rrela = cdw10[0] & 0x7;
u8 iekey = (cdw10[0] >> 3) & 0x1;
u8 rtype = cdw10[1];
trace_seq_printf(p, "rrela=%u, iekey=%u, rtype=%u",
rrela, iekey, rtype);
trace_seq_putc(p, 0);
return ret;
}
static const char *nvme_trace_resv_report(struct trace_seq *p, u8 *cdw10)
{
const char *ret = trace_seq_buffer_ptr(p);
u32 numd = get_unaligned_le32(cdw10);
u8 eds = cdw10[4] & 0x1;
trace_seq_printf(p, "numd=%u, eds=%u", numd, eds);
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);
......@@ -275,6 +329,14 @@ const char *nvme_trace_parse_nvm_cmd(struct trace_seq *p,
return nvme_trace_zone_mgmt_send(p, cdw10);
case nvme_cmd_zone_mgmt_recv:
return nvme_trace_zone_mgmt_recv(p, cdw10);
case nvme_cmd_resv_register:
return nvme_trace_resv_reg(p, cdw10);
case nvme_cmd_resv_acquire:
return nvme_trace_resv_acq(p, cdw10);
case nvme_cmd_resv_release:
return nvme_trace_resv_rel(p, cdw10);
case nvme_cmd_resv_report:
return nvme_trace_resv_report(p, cdw10);
default:
return nvme_trace_common(p, cdw10);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment