2019-02-18 08:36:29 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
/*
|
|
|
|
* NVM Express device driver tracepoints
|
|
|
|
* Copyright (c) 2018 Johannes Thumshirn, SUSE Linux GmbH
|
|
|
|
*/
|
|
|
|
|
2024-10-01 19:35:57 +00:00
|
|
|
#include <linux/unaligned.h>
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
#include "trace.h"
|
|
|
|
|
nvme-trace: add delete completion and submission queue to admin cmds tracer
The trace log for 'delete I/O submission queue' and 'delete I/O
completion queue' command will look like as below:
kworker/u49:1-3438 [003] .... 6693.070865: nvme_setup_cmd: nvme0: qid=0, cmdid=11, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_delete_sq sqid=1)
kworker/u49:1-3438 [003] .... 6693.071171: nvme_setup_cmd: nvme0: qid=0, cmdid=8, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_delete_cq cqid=24)
Signed-off-by: Tom Wu <tomwu@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Israel Rukshin <israelr@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2019-07-04 10:19:54 +00:00
|
|
|
static const char *nvme_trace_delete_sq(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u16 sqid = get_unaligned_le16(cdw10);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "sqid=%u", sqid);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
static const char *nvme_trace_create_sq(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u16 sqid = get_unaligned_le16(cdw10);
|
|
|
|
u16 qsize = get_unaligned_le16(cdw10 + 2);
|
|
|
|
u16 sq_flags = get_unaligned_le16(cdw10 + 4);
|
|
|
|
u16 cqid = get_unaligned_le16(cdw10 + 6);
|
|
|
|
|
|
|
|
|
|
|
|
trace_seq_printf(p, "sqid=%u, qsize=%u, sq_flags=0x%x, cqid=%u",
|
|
|
|
sqid, qsize, sq_flags, cqid);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
nvme-trace: add delete completion and submission queue to admin cmds tracer
The trace log for 'delete I/O submission queue' and 'delete I/O
completion queue' command will look like as below:
kworker/u49:1-3438 [003] .... 6693.070865: nvme_setup_cmd: nvme0: qid=0, cmdid=11, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_delete_sq sqid=1)
kworker/u49:1-3438 [003] .... 6693.071171: nvme_setup_cmd: nvme0: qid=0, cmdid=8, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_delete_cq cqid=24)
Signed-off-by: Tom Wu <tomwu@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Israel Rukshin <israelr@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2019-07-04 10:19:54 +00:00
|
|
|
static const char *nvme_trace_delete_cq(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u16 cqid = get_unaligned_le16(cdw10);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "cqid=%u", cqid);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
static const char *nvme_trace_create_cq(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u16 cqid = get_unaligned_le16(cdw10);
|
|
|
|
u16 qsize = get_unaligned_le16(cdw10 + 2);
|
|
|
|
u16 cq_flags = get_unaligned_le16(cdw10 + 4);
|
|
|
|
u16 irq_vector = get_unaligned_le16(cdw10 + 6);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "cqid=%u, qsize=%u, cq_flags=0x%x, irq_vector=%u",
|
|
|
|
cqid, qsize, cq_flags, irq_vector);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *nvme_trace_admin_identify(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u8 cns = cdw10[0];
|
|
|
|
u16 ctrlid = get_unaligned_le16(cdw10 + 2);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "cns=%u, ctrlid=%u", cns, ctrlid);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
nvme: add set feature tracing support
A nvme connect command produces following trace.
Before:
/sys/kernel/debug/tracing# cat trace | grep feature
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:
/sys/kernel/debug/tracing# cat trace | grep feature
kworker/0:1H-253 [000] .... 196.060509: nvme_setup_cmd: nvme0: qid=0, cmdid=29, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features fid=0x7, sv=0x0, cdw11=0x70007)
kworker/0:1H-253 [000] .... 196.763947: nvme_setup_cmd: nvme0: qid=0, cmdid=29, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features fid=0xb, sv=0x0, cdw11=0x900)
Using ',' to separate different field like others in
nvmet_trace_admin_get_features.
Signed-off-by: Hou Pu <houpu.main@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2021-07-05 03:15:28 +00:00
|
|
|
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;
|
|
|
|
u32 cdw11 = get_unaligned_le32(cdw10 + 4);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "fid=0x%x, sv=0x%x, cdw11=0x%x", fid, sv, cdw11);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
nvme: add get-feature to admin cmds tracer
This will print get-feature cmd in more informative way. For example,
run "nvme get-feature /dev/nvme0 -n 1 -f 0x9 -c 10" will trace:
nvme-3907 [008] .... 1763.635054: nvme_setup_cmd: nvme0: qid=0, cmdid=6, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_admin_get_features fid=0x9 sel=0x0 cdw11=0xa)
<idle>-0 [001] d.h. 1763.635112: nvme_sq: nvme0: qid=0, head=27, tail=27
<idle>-0 [008] ..s. 1763.635121: nvme_complete_rq: nvme0: qid=0, cmdid=6, res=10, retries=0, flags=0x2, status=0
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-13 17:54:54 +00:00
|
|
|
static const char *nvme_trace_admin_get_features(struct trace_seq *p,
|
|
|
|
u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u8 fid = cdw10[0];
|
|
|
|
u8 sel = cdw10[1] & 0x7;
|
|
|
|
u32 cdw11 = get_unaligned_le32(cdw10 + 4);
|
|
|
|
|
nvme: add set feature tracing support
A nvme connect command produces following trace.
Before:
/sys/kernel/debug/tracing# cat trace | grep feature
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:
/sys/kernel/debug/tracing# cat trace | grep feature
kworker/0:1H-253 [000] .... 196.060509: nvme_setup_cmd: nvme0: qid=0, cmdid=29, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features fid=0x7, sv=0x0, cdw11=0x70007)
kworker/0:1H-253 [000] .... 196.763947: nvme_setup_cmd: nvme0: qid=0, cmdid=29, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features fid=0xb, sv=0x0, cdw11=0x900)
Using ',' to separate different field like others in
nvmet_trace_admin_get_features.
Signed-off-by: Hou Pu <houpu.main@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2021-07-05 03:15:28 +00:00
|
|
|
trace_seq_printf(p, "fid=0x%x, sel=0x%x, cdw11=0x%x", fid, sel, cdw11);
|
nvme: add get-feature to admin cmds tracer
This will print get-feature cmd in more informative way. For example,
run "nvme get-feature /dev/nvme0 -n 1 -f 0x9 -c 10" will trace:
nvme-3907 [008] .... 1763.635054: nvme_setup_cmd: nvme0: qid=0, cmdid=6, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_admin_get_features fid=0x9 sel=0x0 cdw11=0xa)
<idle>-0 [001] d.h. 1763.635112: nvme_sq: nvme0: qid=0, head=27, tail=27
<idle>-0 [008] ..s. 1763.635121: nvme_complete_rq: nvme0: qid=0, cmdid=6, res=10, retries=0, flags=0x2, status=0
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-13 17:54:54 +00:00
|
|
|
trace_seq_putc(p, 0);
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
|
nvme: add get-feature to admin cmds tracer
This will print get-feature cmd in more informative way. For example,
run "nvme get-feature /dev/nvme0 -n 1 -f 0x9 -c 10" will trace:
nvme-3907 [008] .... 1763.635054: nvme_setup_cmd: nvme0: qid=0, cmdid=6, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_admin_get_features fid=0x9 sel=0x0 cdw11=0xa)
<idle>-0 [001] d.h. 1763.635112: nvme_sq: nvme0: qid=0, head=27, tail=27
<idle>-0 [008] ..s. 1763.635121: nvme_complete_rq: nvme0: qid=0, cmdid=6, res=10, retries=0, flags=0x2, status=0
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-13 17:54:54 +00:00
|
|
|
return ret;
|
|
|
|
}
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
|
2019-08-04 07:50:49 +00:00
|
|
|
static const char *nvme_trace_get_lba_status(struct trace_seq *p,
|
|
|
|
u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u64 slba = get_unaligned_le64(cdw10);
|
|
|
|
u32 mndw = get_unaligned_le32(cdw10 + 8);
|
|
|
|
u16 rl = get_unaligned_le16(cdw10 + 12);
|
|
|
|
u8 atype = cdw10[15];
|
|
|
|
|
|
|
|
trace_seq_printf(p, "slba=0x%llx, mndw=0x%x, rl=0x%x, atype=%u",
|
|
|
|
slba, mndw, rl, atype);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2021-01-04 15:53:43 +00:00
|
|
|
static const char *nvme_trace_admin_format_nvm(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
2024-01-31 09:12:22 +00:00
|
|
|
/*
|
|
|
|
* lbafu(bit 13:12) is already in the upper 4 bits, lbafl: bit 03:00.
|
|
|
|
*/
|
|
|
|
u8 lbaf = (cdw10[1] & 0x30) | (cdw10[0] & 0xF);
|
2021-01-04 15:53:43 +00:00
|
|
|
u8 mset = (cdw10[0] >> 4) & 0x1;
|
|
|
|
u8 pi = (cdw10[0] >> 5) & 0x7;
|
|
|
|
u8 pil = cdw10[1] & 0x1;
|
|
|
|
u8 ses = (cdw10[1] >> 1) & 0x7;
|
|
|
|
|
|
|
|
trace_seq_printf(p, "lbaf=%u, mset=%u, pi=%u, pil=%u, ses=%u",
|
|
|
|
lbaf, mset, pi, pil, ses);
|
|
|
|
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
static const char *nvme_trace_read_write(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u64 slba = get_unaligned_le64(cdw10);
|
|
|
|
u16 length = get_unaligned_le16(cdw10 + 8);
|
|
|
|
u16 control = get_unaligned_le16(cdw10 + 10);
|
|
|
|
u32 dsmgmt = get_unaligned_le32(cdw10 + 12);
|
|
|
|
u32 reftag = get_unaligned_le32(cdw10 + 16);
|
|
|
|
|
|
|
|
trace_seq_printf(p,
|
|
|
|
"slba=%llu, len=%u, ctrl=0x%x, dsmgmt=%u, reftag=%u",
|
|
|
|
slba, length, control, dsmgmt, reftag);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *nvme_trace_dsm(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "nr=%u, attributes=%u",
|
|
|
|
get_unaligned_le32(cdw10),
|
|
|
|
get_unaligned_le32(cdw10 + 4));
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2021-01-26 17:50:00 +00:00
|
|
|
static const char *nvme_trace_zone_mgmt_send(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
2024-03-12 07:52:43 +00:00
|
|
|
static const char * const zsa_strs[] = {
|
|
|
|
[0x01] = "close zone",
|
|
|
|
[0x02] = "finish zone",
|
|
|
|
[0x03] = "open zone",
|
|
|
|
[0x04] = "reset zone",
|
|
|
|
[0x05] = "offline zone",
|
|
|
|
[0x10] = "set zone descriptor extension"
|
|
|
|
};
|
2021-01-26 17:50:00 +00:00
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u64 slba = get_unaligned_le64(cdw10);
|
2024-03-12 07:52:43 +00:00
|
|
|
const char *zsa_str;
|
2021-01-26 17:50:00 +00:00
|
|
|
u8 zsa = cdw10[12];
|
|
|
|
u8 all = cdw10[13];
|
|
|
|
|
2024-03-12 07:52:43 +00:00
|
|
|
if (zsa < ARRAY_SIZE(zsa_strs) && zsa_strs[zsa])
|
|
|
|
zsa_str = zsa_strs[zsa];
|
|
|
|
else
|
|
|
|
zsa_str = "reserved";
|
|
|
|
|
|
|
|
trace_seq_printf(p, "slba=%llu, zsa=%u:%s, all=%u",
|
|
|
|
slba, zsa, zsa_str, all);
|
2021-01-26 17:50:00 +00:00
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *nvme_trace_zone_mgmt_recv(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
2024-03-12 07:52:43 +00:00
|
|
|
static const char * const zrasf_strs[] = {
|
|
|
|
[0x00] = "list all zones",
|
|
|
|
[0x01] = "list the zones in the ZSE: Empty state",
|
|
|
|
[0x02] = "list the zones in the ZSIO: Implicitly Opened state",
|
|
|
|
[0x03] = "list the zones in the ZSEO: Explicitly Opened state",
|
|
|
|
[0x04] = "list the zones in the ZSC: Closed state",
|
|
|
|
[0x05] = "list the zones in the ZSF: Full state",
|
|
|
|
[0x06] = "list the zones in the ZSRO: Read Only state",
|
|
|
|
[0x07] = "list the zones in the ZSO: Offline state",
|
|
|
|
[0x09] = "list the zones that have the zone attribute"
|
|
|
|
};
|
2021-01-26 17:50:00 +00:00
|
|
|
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];
|
2024-03-12 07:52:43 +00:00
|
|
|
const char *zrasf_str;
|
2021-01-26 17:50:00 +00:00
|
|
|
u8 pr = cdw10[14];
|
|
|
|
|
2024-03-12 07:52:43 +00:00
|
|
|
if (zrasf < ARRAY_SIZE(zrasf_strs) && zrasf_strs[zrasf])
|
|
|
|
zrasf_str = zrasf_strs[zrasf];
|
|
|
|
else
|
|
|
|
zrasf_str = "reserved";
|
|
|
|
|
|
|
|
trace_seq_printf(p, "slba=%llu, numd=%u, zra=%u, zrasf=%u:%s, pr=%u",
|
|
|
|
slba, numd, zra, zrasf, zrasf_str, pr);
|
2021-01-26 17:50:00 +00:00
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2024-01-31 09:12:20 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
static const char *nvme_trace_common(struct trace_seq *p, u8 *cdw10)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "cdw10=%*ph", 24, cdw10);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *nvme_trace_parse_admin_cmd(struct trace_seq *p,
|
|
|
|
u8 opcode, u8 *cdw10)
|
|
|
|
{
|
|
|
|
switch (opcode) {
|
nvme-trace: add delete completion and submission queue to admin cmds tracer
The trace log for 'delete I/O submission queue' and 'delete I/O
completion queue' command will look like as below:
kworker/u49:1-3438 [003] .... 6693.070865: nvme_setup_cmd: nvme0: qid=0, cmdid=11, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_delete_sq sqid=1)
kworker/u49:1-3438 [003] .... 6693.071171: nvme_setup_cmd: nvme0: qid=0, cmdid=8, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_delete_cq cqid=24)
Signed-off-by: Tom Wu <tomwu@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Israel Rukshin <israelr@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2019-07-04 10:19:54 +00:00
|
|
|
case nvme_admin_delete_sq:
|
|
|
|
return nvme_trace_delete_sq(p, cdw10);
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
case nvme_admin_create_sq:
|
|
|
|
return nvme_trace_create_sq(p, cdw10);
|
nvme-trace: add delete completion and submission queue to admin cmds tracer
The trace log for 'delete I/O submission queue' and 'delete I/O
completion queue' command will look like as below:
kworker/u49:1-3438 [003] .... 6693.070865: nvme_setup_cmd: nvme0: qid=0, cmdid=11, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_delete_sq sqid=1)
kworker/u49:1-3438 [003] .... 6693.071171: nvme_setup_cmd: nvme0: qid=0, cmdid=8, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_delete_cq cqid=24)
Signed-off-by: Tom Wu <tomwu@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Israel Rukshin <israelr@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2019-07-04 10:19:54 +00:00
|
|
|
case nvme_admin_delete_cq:
|
|
|
|
return nvme_trace_delete_cq(p, cdw10);
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
case nvme_admin_create_cq:
|
|
|
|
return nvme_trace_create_cq(p, cdw10);
|
|
|
|
case nvme_admin_identify:
|
|
|
|
return nvme_trace_admin_identify(p, cdw10);
|
nvme: add set feature tracing support
A nvme connect command produces following trace.
Before:
/sys/kernel/debug/tracing# cat trace | grep feature
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:
/sys/kernel/debug/tracing# cat trace | grep feature
kworker/0:1H-253 [000] .... 196.060509: nvme_setup_cmd: nvme0: qid=0, cmdid=29, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features fid=0x7, sv=0x0, cdw11=0x70007)
kworker/0:1H-253 [000] .... 196.763947: nvme_setup_cmd: nvme0: qid=0, cmdid=29, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_set_features fid=0xb, sv=0x0, cdw11=0x900)
Using ',' to separate different field like others in
nvmet_trace_admin_get_features.
Signed-off-by: Hou Pu <houpu.main@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2021-07-05 03:15:28 +00:00
|
|
|
case nvme_admin_set_features:
|
|
|
|
return nvme_trace_admin_set_features(p, cdw10);
|
nvme: add get-feature to admin cmds tracer
This will print get-feature cmd in more informative way. For example,
run "nvme get-feature /dev/nvme0 -n 1 -f 0x9 -c 10" will trace:
nvme-3907 [008] .... 1763.635054: nvme_setup_cmd: nvme0: qid=0, cmdid=6, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_admin_get_features fid=0x9 sel=0x0 cdw11=0xa)
<idle>-0 [001] d.h. 1763.635112: nvme_sq: nvme0: qid=0, head=27, tail=27
<idle>-0 [008] ..s. 1763.635121: nvme_complete_rq: nvme0: qid=0, cmdid=6, res=10, retries=0, flags=0x2, status=0
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-13 17:54:54 +00:00
|
|
|
case nvme_admin_get_features:
|
|
|
|
return nvme_trace_admin_get_features(p, cdw10);
|
2019-08-04 07:50:49 +00:00
|
|
|
case nvme_admin_get_lba_status:
|
|
|
|
return nvme_trace_get_lba_status(p, cdw10);
|
2021-01-04 15:53:43 +00:00
|
|
|
case nvme_admin_format_nvm:
|
|
|
|
return nvme_trace_admin_format_nvm(p, cdw10);
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
default:
|
|
|
|
return nvme_trace_common(p, cdw10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *nvme_trace_parse_nvm_cmd(struct trace_seq *p,
|
|
|
|
u8 opcode, u8 *cdw10)
|
|
|
|
{
|
|
|
|
switch (opcode) {
|
|
|
|
case nvme_cmd_read:
|
|
|
|
case nvme_cmd_write:
|
|
|
|
case nvme_cmd_write_zeroes:
|
2021-01-26 17:50:00 +00:00
|
|
|
case nvme_cmd_zone_append:
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
return nvme_trace_read_write(p, cdw10);
|
|
|
|
case nvme_cmd_dsm:
|
|
|
|
return nvme_trace_dsm(p, cdw10);
|
2021-01-26 17:50:00 +00:00
|
|
|
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);
|
2024-01-31 09:12:20 +00:00
|
|
|
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);
|
nvme: add tracepoint for nvme_setup_cmd
Add tracepoints for nvme_setup_cmd() for tracing admin and/or nvm commands.
Examples of the two tracepoints are as follows for trace_nvme_setup_admin_cmd():
kworker/u8:0-5 [003] .... 2.998792: nvme_setup_admin_cmd: cmdid=14, flags=0x0, meta=0x0, cmd=(nvme_admin_create_cq cqid=1, qsize=1023, cq_flags=0x3, irq_vector=0)
and trace_nvme_setup_nvm_cmd():
dd-205 [001] .... 3.503929: nvme_setup_nvm_cmd: qid=1, nsid=1, cmdid=989, flags=0x0, meta=0x0, cmd=(nvme_cmd_read slba=4096, len=2047, ctrl=0x0, dsmgmt=0, reftag=0)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-26 10:21:37 +00:00
|
|
|
default:
|
|
|
|
return nvme_trace_common(p, cdw10);
|
|
|
|
}
|
|
|
|
}
|
2018-06-29 22:50:03 +00:00
|
|
|
|
2019-06-12 12:45:31 +00:00
|
|
|
static const char *nvme_trace_fabrics_property_set(struct trace_seq *p, u8 *spc)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u8 attrib = spc[0];
|
|
|
|
u32 ofst = get_unaligned_le32(spc + 4);
|
|
|
|
u64 value = get_unaligned_le64(spc + 8);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "attrib=%u, ofst=0x%x, value=0x%llx",
|
|
|
|
attrib, ofst, value);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *nvme_trace_fabrics_connect(struct trace_seq *p, u8 *spc)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u16 recfmt = get_unaligned_le16(spc);
|
|
|
|
u16 qid = get_unaligned_le16(spc + 2);
|
|
|
|
u16 sqsize = get_unaligned_le16(spc + 4);
|
|
|
|
u8 cattr = spc[6];
|
|
|
|
u32 kato = get_unaligned_le32(spc + 8);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "recfmt=%u, qid=%u, sqsize=%u, cattr=%u, kato=%u",
|
|
|
|
recfmt, qid, sqsize, cattr, kato);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *nvme_trace_fabrics_property_get(struct trace_seq *p, u8 *spc)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u8 attrib = spc[0];
|
|
|
|
u32 ofst = get_unaligned_le32(spc + 4);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "attrib=%u, ofst=0x%x", attrib, ofst);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2022-06-27 09:52:02 +00:00
|
|
|
static const char *nvme_trace_fabrics_auth_send(struct trace_seq *p, u8 *spc)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u8 spsp0 = spc[1];
|
|
|
|
u8 spsp1 = spc[2];
|
|
|
|
u8 secp = spc[3];
|
|
|
|
u32 tl = get_unaligned_le32(spc + 4);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "spsp0=%02x, spsp1=%02x, secp=%02x, tl=%u",
|
|
|
|
spsp0, spsp1, secp, tl);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *nvme_trace_fabrics_auth_receive(struct trace_seq *p, u8 *spc)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
u8 spsp0 = spc[1];
|
|
|
|
u8 spsp1 = spc[2];
|
|
|
|
u8 secp = spc[3];
|
|
|
|
u32 al = get_unaligned_le32(spc + 4);
|
|
|
|
|
|
|
|
trace_seq_printf(p, "spsp0=%02x, spsp1=%02x, secp=%02x, al=%u",
|
|
|
|
spsp0, spsp1, secp, al);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2019-06-12 12:45:31 +00:00
|
|
|
static const char *nvme_trace_fabrics_common(struct trace_seq *p, u8 *spc)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
|
2019-06-26 12:43:23 +00:00
|
|
|
trace_seq_printf(p, "specific=%*ph", 24, spc);
|
2019-06-12 12:45:31 +00:00
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *nvme_trace_parse_fabrics_cmd(struct trace_seq *p,
|
|
|
|
u8 fctype, u8 *spc)
|
|
|
|
{
|
|
|
|
switch (fctype) {
|
|
|
|
case nvme_fabrics_type_property_set:
|
|
|
|
return nvme_trace_fabrics_property_set(p, spc);
|
|
|
|
case nvme_fabrics_type_connect:
|
|
|
|
return nvme_trace_fabrics_connect(p, spc);
|
|
|
|
case nvme_fabrics_type_property_get:
|
|
|
|
return nvme_trace_fabrics_property_get(p, spc);
|
2022-06-27 09:52:02 +00:00
|
|
|
case nvme_fabrics_type_auth_send:
|
|
|
|
return nvme_trace_fabrics_auth_send(p, spc);
|
|
|
|
case nvme_fabrics_type_auth_receive:
|
|
|
|
return nvme_trace_fabrics_auth_receive(p, spc);
|
2019-06-12 12:45:31 +00:00
|
|
|
default:
|
|
|
|
return nvme_trace_fabrics_common(p, spc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-29 22:50:03 +00:00
|
|
|
const char *nvme_trace_disk_name(struct trace_seq *p, char *name)
|
|
|
|
{
|
|
|
|
const char *ret = trace_seq_buffer_ptr(p);
|
|
|
|
|
|
|
|
if (*name)
|
|
|
|
trace_seq_printf(p, "disk=%s, ", name);
|
|
|
|
trace_seq_putc(p, 0);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2018-12-18 16:59:53 +00:00
|
|
|
|
|
|
|
EXPORT_TRACEPOINT_SYMBOL_GPL(nvme_sq);
|