[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 8/9] hw/block/nvme: add trace event for requests with non-zero st
From: |
Keith Busch |
Subject: |
[PATCH 8/9] hw/block/nvme: add trace event for requests with non-zero status code |
Date: |
Wed, 30 Sep 2020 15:04:13 -0700 |
From: Klaus Jensen <k.jensen@samsung.com>
If a command results in a non-zero status code, trace it.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
hw/block/nvme.c | 6 ++++++
hw/block/trace-events | 1 +
2 files changed, 7 insertions(+)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index dc971c9653..16804d0278 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -777,6 +777,12 @@ static void nvme_enqueue_req_completion(NvmeCQueue *cq,
NvmeRequest *req)
assert(cq->cqid == req->sq->cqid);
trace_pci_nvme_enqueue_req_completion(nvme_cid(req), cq->cqid,
req->status);
+
+ if (req->status) {
+ trace_pci_nvme_err_req_status(nvme_cid(req), nvme_nsid(req->ns),
+ req->status, req->cmd.opcode);
+ }
+
QTAILQ_REMOVE(&req->sq->out_req_list, req, entry);
QTAILQ_INSERT_TAIL(&cq->req_list, req, entry);
timer_mod(cq->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 500);
diff --git a/hw/block/trace-events b/hw/block/trace-events
index 180c43d258..ff3ca4bbf6 100644
--- a/hw/block/trace-events
+++ b/hw/block/trace-events
@@ -89,6 +89,7 @@ pci_nvme_mmio_shutdown_cleared(void) "shutdown bit cleared"
# nvme traces for error conditions
pci_nvme_err_mdts(uint16_t cid, size_t len) "cid %"PRIu16" len %zu"
+pci_nvme_err_req_status(uint16_t cid, uint32_t nsid, uint16_t status, uint8_t
opc) "cid %"PRIu16" nsid %"PRIu32" status 0x%"PRIx16" opc 0x%"PRIx8""
pci_nvme_err_addr_read(uint64_t addr) "addr 0x%"PRIx64""
pci_nvme_err_addr_write(uint64_t addr) "addr 0x%"PRIx64""
pci_nvme_err_cfs(void) "controller fatal status"
--
2.24.1
- [PATCH 0/9] nvme qemu cleanups and fixes, Keith Busch, 2020/09/30
- [PATCH 1/9] hw/block/nvme: remove pointless rw indirection, Keith Busch, 2020/09/30
- [PATCH 3/9] hw/block/nvme: support per-namespace smart log, Keith Busch, 2020/09/30
- [PATCH 4/9] hw/block/nvme: validate command set selected, Keith Busch, 2020/09/30
- [PATCH 2/9] hw/block/nvme: fix log page offset check, Keith Busch, 2020/09/30
- [PATCH 6/9] hw/block/nvme: reject io commands if only admin command set selected, Keith Busch, 2020/09/30
- [PATCH 5/9] hw/block/nvme: support for admin-only command set, Keith Busch, 2020/09/30
- [PATCH 7/9] hw/block/nvme: add nsid to get/setfeat trace events, Keith Busch, 2020/09/30
- [PATCH 8/9] hw/block/nvme: add trace event for requests with non-zero status code,
Keith Busch <=
- [PATCH 9/9] hw/block/nvme: report actual LBA data shift in LBAF, Keith Busch, 2020/09/30