From 9765e956b92122f0c2ca9b83ac14548fe416a363 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Mon, 25 Jan 2021 16:02:35 +0000 Subject: [PATCH] nvme_perf: separate read/write error messages Next patch will add rate limiting on some of the error messages. Separating the read error message from the write error message will allow us to rate limit them independently. Signed-off-by: Jim Harris Change-Id: Id49b64aa1ee545874d7230399a5127c47f217836 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6076 Tested-by: SPDK CI Jenkins Reviewed-by: sunshihao Reviewed-by: Tomasz Zawadzki Reviewed-by: Aleksey Marchuk --- examples/nvme/perf/perf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 18251fdb9..2f6be1f79 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -1316,9 +1316,13 @@ io_complete(void *ctx, const struct spdk_nvme_cpl *cpl) struct perf_task *task = ctx; if (spdk_unlikely(spdk_nvme_cpl_is_error(cpl))) { - fprintf(stderr, "%s completed with error (sct=%d, sc=%d)\n", - task->is_read ? "Read" : "Write", - cpl->status.sct, cpl->status.sc); + if (task->is_read) { + fprintf(stderr, "Read completed with error (sct=%d, sc=%d)\n", + cpl->status.sct, cpl->status.sc); + } else { + fprintf(stderr, "Write completed with error (sct=%d, sc=%d)\n", + cpl->status.sct, cpl->status.sc); + } } task_complete(task);