diff --git a/lib/nvme/nvme_pcie_common.c b/lib/nvme/nvme_pcie_common.c index 614cac29d0..6ca93225a5 100644 --- a/lib/nvme/nvme_pcie_common.c +++ b/lib/nvme/nvme_pcie_common.c @@ -633,6 +633,7 @@ nvme_pcie_qpair_complete_tracker(struct spdk_nvme_qpair *qpair, struct nvme_trac struct nvme_request *req; bool retry, error; bool req_from_current_proc = true; + bool print_error; req = tr->req; @@ -641,9 +642,13 @@ nvme_pcie_qpair_complete_tracker(struct spdk_nvme_qpair *qpair, struct nvme_trac error = spdk_nvme_cpl_is_error(cpl); retry = error && nvme_completion_is_retry(cpl) && req->retries < pqpair->retry_count; + print_error = error && print_on_error && !qpair->ctrlr->opts.disable_error_logging; - if (error && print_on_error && !qpair->ctrlr->opts.disable_error_logging) { + if (print_error) { spdk_nvme_qpair_print_command(qpair, &req->cmd); + } + + if (print_error || SPDK_DEBUGLOG_FLAG_ENABLED("nvme")) { spdk_nvme_qpair_print_completion(qpair, cpl); } diff --git a/lib/nvme/nvme_qpair.c b/lib/nvme/nvme_qpair.c index 5b2c6f1036..d4e9b03464 100644 --- a/lib/nvme/nvme_qpair.c +++ b/lib/nvme/nvme_qpair.c @@ -936,6 +936,9 @@ _nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *r } if (spdk_likely(rc == 0)) { + if (SPDK_DEBUGLOG_FLAG_ENABLED("nvme")) { + spdk_nvme_print_command(qpair->id, &req->cmd); + } req->queued = false; return 0; }