From 8a2527836d387a4c7dcb576cbb33ad605ee28175 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Wed, 25 Sep 2019 16:18:08 -0700 Subject: [PATCH] log: remove old-style errlog entries. SPDK_ERRLOG lists the function name, so remove old references that assume it doesn't and reprint the function name. Change-Id: I69da6ca0a25bf0eda07d8dad52bcfadf964ac715 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469487 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- lib/blob/blobstore.c | 2 +- lib/env_dpdk/memory.c | 4 ++-- lib/net/interface.c | 2 +- lib/nvme/nvme_ctrlr.c | 4 ++-- lib/nvme/nvme_pcie.c | 3 +-- lib/nvmf/fc.c | 18 +++++++++--------- lib/thread/thread.c | 6 +++--- lib/trace/trace_flags.c | 6 +++--- 8 files changed, 22 insertions(+), 23 deletions(-) diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c index 444ad896f..36ff6816f 100644 --- a/lib/blob/blobstore.c +++ b/lib/blob/blobstore.c @@ -1803,7 +1803,7 @@ _spdk_blob_request_submit_op_split_next(void *cb_arg, int bserrno) break; case SPDK_BLOB_READV: case SPDK_BLOB_WRITEV: - SPDK_ERRLOG("readv/write not valid for %s\n", __func__); + SPDK_ERRLOG("readv/write not valid\n"); spdk_bs_sequence_finish(ctx->seq, -EINVAL); free(ctx); break; diff --git a/lib/env_dpdk/memory.c b/lib/env_dpdk/memory.c index b287a2f3e..73fe8ae2a 100644 --- a/lib/env_dpdk/memory.c +++ b/lib/env_dpdk/memory.c @@ -1000,8 +1000,8 @@ spdk_vtophys_notify(void *cb_ctx, struct spdk_mem_map *map, } if (((uintptr_t)vaddr & MASK_2MB) || (len & MASK_2MB)) { - DEBUG_PRINT("invalid %s parameters, vaddr=%p len=%ju\n", - __func__, vaddr, len); + DEBUG_PRINT("invalid parameters, vaddr=%p len=%ju\n", + vaddr, len); return -EINVAL; } diff --git a/lib/net/interface.c b/lib/net/interface.c index 5bbdb0777..2a11ee3ca 100644 --- a/lib/net/interface.c +++ b/lib/net/interface.c @@ -167,7 +167,7 @@ static int spdk_process_new_interface_msg(struct nlmsghdr *h) ifc = (struct spdk_interface *) malloc(sizeof(*ifc)); if (ifc == NULL) { - SPDK_ERRLOG("%s: Malloc failed\n", __func__); + SPDK_ERRLOG("Malloc failed\n"); return 1; } diff --git a/lib/nvme/nvme_ctrlr.c b/lib/nvme/nvme_ctrlr.c index 9f659371c..bd9013040 100644 --- a/lib/nvme/nvme_ctrlr.c +++ b/lib/nvme/nvme_ctrlr.c @@ -674,7 +674,7 @@ nvme_ctrlr_enable(struct spdk_nvme_ctrlr *ctrlr) } if (cc.bits.en != 0) { - SPDK_ERRLOG("%s called with CC.EN = 1\n", __func__); + SPDK_ERRLOG("called with CC.EN = 1\n"); return -EINVAL; } @@ -986,7 +986,7 @@ spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr) while (ctrlr->state != NVME_CTRLR_STATE_READY) { if (nvme_ctrlr_process_init(ctrlr) != 0) { - SPDK_ERRLOG("%s: controller reinitialization failed\n", __func__); + SPDK_ERRLOG("controller reinitialization failed\n"); nvme_ctrlr_fail(ctrlr, false); rc = -1; break; diff --git a/lib/nvme/nvme_pcie.c b/lib/nvme/nvme_pcie.c index 4f6550a48..1f30702ec 100644 --- a/lib/nvme/nvme_pcie.c +++ b/lib/nvme/nvme_pcie.c @@ -639,8 +639,7 @@ nvme_pcie_ctrlr_free_cmb_io_buffer(struct spdk_nvme_ctrlr *ctrlr, void *buf, siz * Do nothing for now. * TODO: Track free space so buffers may be reused. */ - SPDK_ERRLOG("%s: no deallocation for CMB buffers yet!\n", - __func__); + SPDK_ERRLOG("no deallocation for CMB buffers yet!\n"); return 0; } diff --git a/lib/nvmf/fc.c b/lib/nvmf/fc.c index 8ac1cd2fb..7e358c764 100644 --- a/lib/nvmf/fc.c +++ b/lib/nvmf/fc.c @@ -1208,7 +1208,7 @@ spdk_nvmf_fc_request_abort(struct spdk_nvmf_fc_request *fc_req, bool send_abts, if (cb) { ctx = calloc(1, sizeof(struct spdk_nvmf_fc_caller_ctx)); if (!ctx) { - SPDK_ERRLOG("%s: ctx alloc failed.\n", __func__); + SPDK_ERRLOG("ctx alloc failed.\n"); return; } ctx->cb = cb; @@ -1263,7 +1263,7 @@ spdk_nvmf_fc_request_abort(struct spdk_nvmf_fc_request *fc_req, bool send_abts, goto complete; } else { /* Should never happen */ - SPDK_ERRLOG("%s: Request in invalid state\n", __func__); + SPDK_ERRLOG("Request in invalid state\n"); goto complete; } @@ -1545,11 +1545,11 @@ spdk_nvmf_fc_hwqp_process_frame(struct spdk_nvmf_fc_hwqp *hwqp, rc = nvmf_fc_hwqp_find_nport_and_rport(hwqp, d_id, &nport, s_id, &rport); if (rc) { if (nport == NULL) { - SPDK_ERRLOG("%s: Nport not found. Dropping\n", __func__); + SPDK_ERRLOG("Nport not found. Dropping\n"); /* increment invalid nport counter */ hwqp->counters.nport_invalid++; } else if (rport == NULL) { - SPDK_ERRLOG("%s: Rport not found. Dropping\n", __func__); + SPDK_ERRLOG("Rport not found. Dropping\n"); /* increment invalid rport counter */ hwqp->counters.rport_invalid++; } @@ -1558,7 +1558,7 @@ spdk_nvmf_fc_hwqp_process_frame(struct spdk_nvmf_fc_hwqp *hwqp, if (nport->nport_state != SPDK_NVMF_FC_OBJECT_CREATED || rport->rport_state != SPDK_NVMF_FC_OBJECT_CREATED) { - SPDK_ERRLOG("%s: %s state not created. Dropping\n", __func__, + SPDK_ERRLOG("%s state not created. Dropping\n", nport->nport_state != SPDK_NVMF_FC_OBJECT_CREATED ? "Nport" : "Rport"); return -EACCES; @@ -1612,7 +1612,7 @@ spdk_nvmf_fc_hwqp_process_frame(struct spdk_nvmf_fc_hwqp *hwqp, rc = nvmf_fc_hwqp_handle_request(hwqp, frame, buff_idx, buffer, plen); } else { - SPDK_ERRLOG("%s Unknown frame received. Dropping\n", __func__); + SPDK_ERRLOG("Unknown frame received. Dropping\n"); hwqp->counters.unknown_frame++; rc = -EINVAL; } @@ -1654,11 +1654,11 @@ spdk_nvmf_fc_hwqp_process_pending_ls_rqsts(struct spdk_nvmf_fc_hwqp *hwqp) int rc = nvmf_fc_hwqp_find_nport_and_rport(hwqp, ls_rqst->d_id, &nport, ls_rqst->s_id, &rport); if (rc) { if (nport == NULL) { - SPDK_ERRLOG("%s: Nport not found. Dropping\n", __func__); + SPDK_ERRLOG("Nport not found. Dropping\n"); /* increment invalid nport counter */ hwqp->counters.nport_invalid++; } else if (rport == NULL) { - SPDK_ERRLOG("%s: Rport not found. Dropping\n", __func__); + SPDK_ERRLOG("Rport not found. Dropping\n"); /* increment invalid rport counter */ hwqp->counters.rport_invalid++; } @@ -1669,7 +1669,7 @@ spdk_nvmf_fc_hwqp_process_pending_ls_rqsts(struct spdk_nvmf_fc_hwqp *hwqp) } if (nport->nport_state != SPDK_NVMF_FC_OBJECT_CREATED || rport->rport_state != SPDK_NVMF_FC_OBJECT_CREATED) { - SPDK_ERRLOG("%s: %s state not created. Dropping\n", __func__, + SPDK_ERRLOG("%s state not created. Dropping\n", nport->nport_state != SPDK_NVMF_FC_OBJECT_CREATED ? "Nport" : "Rport"); TAILQ_REMOVE(&hwqp->ls_pending_queue, ls_rqst, ls_pending_link); diff --git a/lib/thread/thread.c b/lib/thread/thread.c index f64641010..98581bd92 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -843,7 +843,7 @@ spdk_io_device_register(void *io_device, spdk_io_channel_create_cb create_cb, thread = spdk_get_thread(); if (!thread) { - SPDK_ERRLOG("%s called from non-SPDK thread\n", __func__); + SPDK_ERRLOG("called from non-SPDK thread\n"); assert(false); return; } @@ -919,7 +919,7 @@ spdk_io_device_unregister(void *io_device, spdk_io_device_unregister_cb unregist thread = spdk_get_thread(); if (!thread) { - SPDK_ERRLOG("%s called from non-SPDK thread\n", __func__); + SPDK_ERRLOG("called from non-SPDK thread\n"); assert(false); return; } @@ -1049,7 +1049,7 @@ _spdk_put_io_channel(void *arg) thread = spdk_get_thread(); if (!thread) { - SPDK_ERRLOG("%s called from non-SPDK thread\n", __func__); + SPDK_ERRLOG("called from non-SPDK thread\n"); assert(false); return; } diff --git a/lib/trace/trace_flags.c b/lib/trace/trace_flags.c index 511f73ecd..615afe355 100644 --- a/lib/trace/trace_flags.c +++ b/lib/trace/trace_flags.c @@ -47,7 +47,7 @@ uint64_t spdk_trace_get_tpoint_mask(uint32_t group_id) { if (group_id >= SPDK_TRACE_MAX_GROUP_ID) { - SPDK_ERRLOG("%s: invalid group ID %d\n", __func__, group_id); + SPDK_ERRLOG("invalid group ID %d\n", group_id); return 0ULL; } @@ -58,7 +58,7 @@ void spdk_trace_set_tpoints(uint32_t group_id, uint64_t tpoint_mask) { if (group_id >= SPDK_TRACE_MAX_GROUP_ID) { - SPDK_ERRLOG("%s: invalid group ID %d\n", __func__, group_id); + SPDK_ERRLOG("invalid group ID %d\n", group_id); return; } @@ -69,7 +69,7 @@ void spdk_trace_clear_tpoints(uint32_t group_id, uint64_t tpoint_mask) { if (group_id >= SPDK_TRACE_MAX_GROUP_ID) { - SPDK_ERRLOG("%s: invalid group ID %d\n", __func__, group_id); + SPDK_ERRLOG("invalid group ID %d\n", group_id); return; }