diff options
author | Klaus Jensen <k.jensen@samsung.com> | 2020-09-30 01:19:05 +0200 |
---|---|---|
committer | Klaus Jensen <k.jensen@samsung.com> | 2020-10-27 11:29:25 +0100 |
commit | dcd1496132704ca16fc857a40370a6b9209341ae (patch) | |
tree | 3108341d4f3000d4ff5601e11b0f7fd87082823e /hw/block/nvme.c | |
parent | 976951048c2fb31ba1622c36d25b4cd69bea5a64 (diff) |
hw/block/nvme: add trace event for requests with non-zero status code
If a command results in a non-zero status code, trace it.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'hw/block/nvme.c')
-rw-r--r-- | hw/block/nvme.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 5fd5a45a28..b8c6be6318 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); |