From 64adbc4951789efe519f66d55c39868adf9e6ebe Mon Sep 17 00:00:00 2001 From: Di Wang Date: Fri, 31 Jan 2025 21:25:23 +0000 Subject: [PATCH 1/4] DAOS-16971 cart: add origin address to RPC debug log Add origin address to RPC debug log. Run-GHA: true Allow-unstable-test: true Signed-off-by: Di Wang --- src/cart/crt_bulk.c | 7 ++++-- src/cart/crt_hg.c | 10 ++++++++ src/cart/crt_internal.h | 54 +++++++++++++++++++++++++++++++++++------ src/cart/crt_rpc.c | 8 ++++-- src/cart/crt_rpc.h | 2 ++ src/include/cart/api.h | 10 ++++++++ src/object/srv_obj.c | 50 ++++++++++++++++++++++---------------- 7 files changed, 108 insertions(+), 33 deletions(-) diff --git a/src/cart/crt_bulk.c b/src/cart/crt_bulk.c index a62d5a45eb1..13723634a8f 100644 --- a/src/cart/crt_bulk.c +++ b/src/cart/crt_bulk.c @@ -1,5 +1,6 @@ /* * (C) Copyright 2016-2022 Intel Corporation. + * (C) Copyright 2025 Google LLC * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -183,7 +184,8 @@ crt_bulk_transfer(struct crt_bulk_desc *bulk_desc, crt_bulk_cb_t complete_cb, rc = crt_hg_bulk_transfer(bulk_desc, complete_cb, arg, opid, false); if (rc != 0) - DL_ERROR(rc, "crt_hg_bulk_transfer() failed"); + DL_ERROR(rc, "%p:%s crt_hg_bulk_transfer() failed", bulk_desc->bd_rpc, + crt_rpc_get_origin_addr(bulk_desc->bd_rpc)); out: return rc; @@ -203,7 +205,8 @@ crt_bulk_bind_transfer(struct crt_bulk_desc *bulk_desc, rc = crt_hg_bulk_transfer(bulk_desc, complete_cb, arg, opid, true); if (rc != 0) - D_ERROR("crt_hg_bulk_transfer() failed, rc: %d.\n", rc); + DL_ERROR(rc, "%p:%s crt_hg_bulk_transfer() failed.\n", bulk_desc->bd_rpc, + crt_rpc_get_origin_addr(bulk_desc->bd_rpc)); out: return rc; diff --git a/src/cart/crt_hg.c b/src/cart/crt_hg.c index 8f2395a44ff..7ffaac03546 100644 --- a/src/cart/crt_hg.c +++ b/src/cart/crt_hg.c @@ -1,5 +1,6 @@ /* * (C) Copyright 2016-2024 Intel Corporation. + * (C) Copyright 2025 Google LLC * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -1872,3 +1873,12 @@ crt_hg_bulk_transfer(struct crt_bulk_desc *bulk_desc, crt_bulk_cb_t complete_cb, out: return rc; } + +char * +crt_rpc_get_origin_addr(crt_rpc_t *rpc_pub) +{ + struct crt_rpc_priv *rpc_priv; + + rpc_priv = container_of(rpc_pub, struct crt_rpc_priv, crp_pub); + return crt_rpc_priv_get_origin_addr(rpc_priv); +} diff --git a/src/cart/crt_internal.h b/src/cart/crt_internal.h index 69d50fe31f0..0d7e2d0a660 100644 --- a/src/cart/crt_internal.h +++ b/src/cart/crt_internal.h @@ -1,6 +1,7 @@ /* * (C) Copyright 2016-2024 Intel Corporation. * (C) Copyright 2025 Hewlett Packard Enterprise Development LP + * (C) Copyright 2025 Google LLC * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -27,6 +28,34 @@ #include "crt_self_test.h" #include "crt_swim.h" +static inline char * +crt_rpc_priv_get_origin_addr(struct crt_rpc_priv *rpc_priv) +{ + const struct hg_info *hg_info; + char addr[48]; + hg_size_t addr_size = 48; + int rc; + + if (rpc_priv->crp_orig_uri != NULL) + return rpc_priv->crp_orig_uri; + + hg_info = HG_Get_info(rpc_priv->crp_hg_hdl); + if (hg_info == NULL) + return "None"; + + rc = HG_Addr_to_string(hg_info->hg_class, addr, (hg_size_t *)&addr_size, hg_info->addr); + if (rc != 0) + return "None"; + + D_ALLOC(rpc_priv->crp_orig_uri, addr_size); + if (rpc_priv->crp_orig_uri == NULL) + return "None"; + + memcpy(rpc_priv->crp_orig_uri, addr, addr_size); + + return rpc_priv->crp_orig_uri; +} + /* A wrapper around D_TRACE_DEBUG that ensures the ptr option is a RPC */ #define RPC_TRACE(mask, rpc, fmt, ...) \ do { \ @@ -38,13 +67,15 @@ \ crt_opc_decode((rpc)->crp_pub.cr_opc, &_module, &_opc); \ if ((rpc)->crp_coll) { \ - D_TRACE_DEBUG(mask, (rpc), "[opc=%#x (%s:%s) rpcid=%#lx CORPC] " fmt, \ + D_TRACE_DEBUG(mask, (rpc), "[opc=%#x (%s:%s:%s) rpcid=%#lx CORPC] " fmt, \ (rpc)->crp_pub.cr_opc, _module, _opc, \ + crt_rpc_priv_get_origin_addr((rpc)), \ (rpc)->crp_req_hdr.cch_rpcid, ##__VA_ARGS__); \ } else { \ D_TRACE_DEBUG(mask, (rpc), \ - "[opc=%#x (%s:%s) rpcid=%#lx rank:tag=%d:%d] " fmt, \ + "[opc=%#x (%s:%s:%s) rpcid=%#lx rank:tag=%d:%d] " fmt, \ (rpc)->crp_pub.cr_opc, _module, _opc, \ + crt_rpc_priv_get_origin_addr((rpc)), \ (rpc)->crp_req_hdr.cch_rpcid, (rpc)->crp_pub.cr_ep.ep_rank, \ (rpc)->crp_pub.cr_ep.ep_tag, ##__VA_ARGS__); \ } \ @@ -58,12 +89,15 @@ \ crt_opc_decode((rpc)->crp_pub.cr_opc, &_module, &_opc); \ if ((rpc)->crp_coll) { \ - D_TRACE_ERROR((rpc), "[opc=%#x (%s:%s) rpcid=%#lx CORPC] " fmt, \ + D_TRACE_ERROR((rpc), "[opc=%#x (%s:%s:%s) rpcid=%#lx CORPC] " fmt, \ (rpc)->crp_pub.cr_opc, _module, _opc, \ + crt_rpc_priv_get_origin_addr((rpc)), \ (rpc)->crp_req_hdr.cch_rpcid, ##__VA_ARGS__); \ } else { \ - D_TRACE_ERROR((rpc), "[opc=%#x (%s:%s) rpcid=%#lx rank:tag=%d:%d] " fmt, \ + D_TRACE_ERROR((rpc), \ + "[opc=%#x (%s:%s:%s) rpcid=%#lx rank:tag=%d:%d] " fmt, \ (rpc)->crp_pub.cr_opc, _module, _opc, \ + crt_rpc_priv_get_origin_addr((rpc)), \ (rpc)->crp_req_hdr.cch_rpcid, (rpc)->crp_pub.cr_ep.ep_rank, \ (rpc)->crp_pub.cr_ep.ep_tag, ##__VA_ARGS__); \ } \ @@ -77,12 +111,14 @@ \ crt_opc_decode((rpc)->crp_pub.cr_opc, &_module, &_opc); \ if ((rpc)->crp_coll) { \ - D_TRACE_WARN((rpc), "[opc=%#x (%s:%s) rpcid=%#lx CORPC] " fmt, \ + D_TRACE_WARN((rpc), "[opc=%#x (%s:%s:%s) rpcid=%#lx CORPC] " fmt, \ (rpc)->crp_pub.cr_opc, _module, _opc, \ + crt_rpc_priv_get_origin_addr((rpc)), \ (rpc)->crp_req_hdr.cch_rpcid, ##__VA_ARGS__); \ } else { \ - D_TRACE_WARN((rpc), "[opc=%#x (%s:%s) rpcid=%#lx rank:tag=%d:%d] " fmt, \ + D_TRACE_WARN((rpc), "[opc=%#x (%s:%s:%s) rpcid=%#lx rank:tag=%d:%d] " fmt, \ (rpc)->crp_pub.cr_opc, _module, _opc, \ + crt_rpc_priv_get_origin_addr((rpc)), \ (rpc)->crp_req_hdr.cch_rpcid, (rpc)->crp_pub.cr_ep.ep_rank, \ (rpc)->crp_pub.cr_ep.ep_tag, ##__VA_ARGS__); \ } \ @@ -96,12 +132,14 @@ \ crt_opc_decode((rpc)->crp_pub.cr_opc, &_module, &_opc); \ if ((rpc)->crp_coll) { \ - D_TRACE_INFO((rpc), "[opc=%#x (%s:%s) rpcid=%#lx CORPC] " fmt, \ + D_TRACE_INFO((rpc), "[opc=%#x (%s:%s:%s) rpcid=%#lx CORPC] " fmt, \ (rpc)->crp_pub.cr_opc, _module, _opc, \ + crt_rpc_priv_get_origin_addr((rpc)), \ (rpc)->crp_req_hdr.cch_rpcid, ##__VA_ARGS__); \ } else { \ - D_TRACE_INFO((rpc), "[opc=%#x (%s:%s) rpcid=%#lx rank:tag=%d:%d] " fmt, \ + D_TRACE_INFO((rpc), "[opc=%#x (%s:%s:%s) rpcid=%#lx rank:tag=%d:%d] " fmt, \ (rpc)->crp_pub.cr_opc, _module, _opc, \ + crt_rpc_priv_get_origin_addr((rpc)), \ (rpc)->crp_req_hdr.cch_rpcid, (rpc)->crp_pub.cr_ep.ep_rank, \ (rpc)->crp_pub.cr_ep.ep_tag, ##__VA_ARGS__); \ } \ diff --git a/src/cart/crt_rpc.c b/src/cart/crt_rpc.c index b9effbeb9ce..e94c9efe108 100644 --- a/src/cart/crt_rpc.c +++ b/src/cart/crt_rpc.c @@ -1,5 +1,6 @@ /* * (C) Copyright 2016-2024 Intel Corporation. + * (C) Copyright 2025 Google LLC * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -573,6 +574,9 @@ crt_rpc_priv_free(struct crt_rpc_priv *rpc_priv) if (rpc_priv->crp_uri_free != 0) D_FREE(rpc_priv->crp_tgt_uri); + if (rpc_priv->crp_orig_uri != NULL) + D_FREE(rpc_priv->crp_orig_uri); + D_MUTEX_DESTROY(&rpc_priv->crp_mutex); D_SPIN_DESTROY(&rpc_priv->crp_lock); @@ -1591,8 +1595,8 @@ crt_reply_send(crt_rpc_t *req) RPC_TRACE(DB_ALL, rpc_priv, "reply_send\n"); rc = crt_hg_reply_send(rpc_priv); if (rc != 0) - D_ERROR("crt_hg_reply_send failed, rc: %d,opc: %#x.\n", - rc, rpc_priv->crp_pub.cr_opc); + D_ERROR("crt_hg_reply_send failed, rc: %d,opc: %#x.: %s\n", rc, + rpc_priv->crp_pub.cr_opc, crt_rpc_get_origin_addr(req)); } rpc_priv->crp_reply_pending = 0; diff --git a/src/cart/crt_rpc.h b/src/cart/crt_rpc.h index b49a93b4cda..f66e593a3ee 100644 --- a/src/cart/crt_rpc.h +++ b/src/cart/crt_rpc.h @@ -1,5 +1,6 @@ /* * (C) Copyright 2016-2024 Intel Corporation. + * (C) Copyright 2025 Google LLC * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -154,6 +155,7 @@ struct crt_rpc_priv { hg_addr_t crp_hg_addr; /* target na address */ struct crt_hg_hdl *crp_hdl_reuse; /* reused hg_hdl */ char *crp_tgt_uri; /* target uri address */ + char *crp_orig_uri; /* where the RPC comes from */ crt_rpc_t *crp_ul_req; /* uri lookup request */ uint32_t crp_ul_retry; /* uri lookup retry counter */ diff --git a/src/include/cart/api.h b/src/include/cart/api.h index 93423e51d66..a8ef4763cae 100644 --- a/src/include/cart/api.h +++ b/src/include/cart/api.h @@ -1,5 +1,6 @@ /* * (C) Copyright 2016-2024 Intel Corporation. + * (C) Copyright 2025 Google LLC * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -2345,6 +2346,15 @@ int crt_context_quota_limit_get(crt_context_t crt_ctx, crt_quota_type_t quota, i int crt_req_get_proto_ver(crt_rpc_t *req); +/** + * Get the rpc origin address. + * + * \param[in] rpc pointer to RPC request + * \return the origin address of the RPC + */ +char * +crt_rpc_get_origin_addr(crt_rpc_t *rpc); + /** @} */ diff --git a/src/object/srv_obj.c b/src/object/srv_obj.c index 6b05b95d329..7498d591004 100644 --- a/src/object/srv_obj.c +++ b/src/object/srv_obj.c @@ -1,6 +1,7 @@ /** * (C) Copyright 2016-2024 Intel Corporation. * (C) Copyright 2025 Hewlett Packard Enterprise Development LP + * (C) Copyright 2025 Google LLC * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -183,9 +184,10 @@ obj_rw_reply(crt_rpc_t *rpc, int status, uint64_t epoch, bool release_input, orwo->orw_epoch = max(epoch, orwo->orw_epoch); } - D_DEBUG(DB_IO, "rpc %p opc %d send reply, pmv %d, epoch "DF_X64 - ", status %d\n", rpc, opc_get(rpc->cr_opc), - ioc->ioc_map_ver, orwo->orw_epoch, status); + DL_CDEBUG(status == 0 || obj_retry_error(status), DB_IO, DLOG_ERR, status, + "rpc %p:%s opc %d send reply, pmv %d, epoch " DF_X64 ", status %d\n", rpc, + crt_rpc_get_origin_addr(rpc), opc_get(rpc->cr_opc), ioc->ioc_map_ver, + orwo->orw_epoch, status); if (!ioc->ioc_lost_reply) { if (release_input) @@ -242,11 +244,13 @@ obj_bulk_comp_cb(const struct crt_bulk_cb_info *cb_info) struct crt_bulk_desc *bulk_desc; crt_rpc_t *rpc; - if (cb_info->bci_rc != 0) - D_ERROR("bulk transfer failed: %d\n", cb_info->bci_rc); - bulk_desc = cb_info->bci_bulk_desc; rpc = bulk_desc->bd_rpc; + + if (cb_info->bci_rc != 0) + D_ERROR("rpc: %p:%s bulk transfer failed: %d\n", rpc, crt_rpc_get_origin_addr(rpc), + cb_info->bci_rc); + arg = (struct obj_bulk_args *)cb_info->bci_arg; /** * Note: only one thread will access arg.result, so @@ -5831,17 +5835,19 @@ ds_obj_coll_punch_handler(crt_rpc_t *rpc) max_ver = version; DL_CDEBUG(rc != 0 && rc != -DER_INPROGRESS && rc != -DER_TX_RESTART, DLOG_ERR, DB_IO, rc, - "(%s) handled collective punch RPC %p for obj "DF_UOID" on XS %u/%u in "DF_UUID"/" - DF_UUID"/"DF_UUID" with epc "DF_X64", pmv %u/%u, dti "DF_DTI", bulk_tgt_sz %u, " + "(%s) handled collective punch RPC %p:%s for obj " DF_UOID + " on XS %u/%u in " DF_UUID "/" DF_UUID "/" DF_UUID " with epc " DF_X64 + ", pmv %u/%u, dti " DF_DTI ", bulk_tgt_sz %u, " "bulk_tgt_nr %u, tgt_nr %u, forward width %u, forward depth %u, flags %x", - (ocpi->ocpi_flags & ORF_LEADER) ? "leader" : - (ocpi->ocpi_tgts.ca_count == 1 ? "non-leader" : "relay-engine"), rpc, - DP_UOID(ocpi->ocpi_oid), dmi->dmi_xs_id, dmi->dmi_tgt_id, - DP_UUID(ocpi->ocpi_po_uuid), DP_UUID(ocpi->ocpi_co_hdl), - DP_UUID(ocpi->ocpi_co_uuid), ocpi->ocpi_epoch, - ocpi->ocpi_map_ver, max_ver, DP_DTI(&ocpi->ocpi_xid), ocpi->ocpi_bulk_tgt_sz, - ocpi->ocpi_bulk_tgt_nr, (unsigned int)ocpi->ocpi_tgts.ca_count, - ocpi->ocpi_disp_width, ocpi->ocpi_disp_depth, ocpi->ocpi_flags); + (ocpi->ocpi_flags & ORF_LEADER) + ? "leader" + : (ocpi->ocpi_tgts.ca_count == 1 ? "non-leader" : "relay-engine"), + rpc, crt_rpc_get_origin_addr(rpc), DP_UOID(ocpi->ocpi_oid), dmi->dmi_xs_id, + dmi->dmi_tgt_id, DP_UUID(ocpi->ocpi_po_uuid), DP_UUID(ocpi->ocpi_co_hdl), + DP_UUID(ocpi->ocpi_co_uuid), ocpi->ocpi_epoch, ocpi->ocpi_map_ver, max_ver, + DP_DTI(&ocpi->ocpi_xid), ocpi->ocpi_bulk_tgt_sz, ocpi->ocpi_bulk_tgt_nr, + (unsigned int)ocpi->ocpi_tgts.ca_count, ocpi->ocpi_disp_width, + ocpi->ocpi_disp_depth, ocpi->ocpi_flags); obj_punch_complete(rpc, rc, max_ver); @@ -5973,11 +5979,13 @@ ds_obj_coll_query_handler(crt_rpc_t *rpc) rc = dtx_leader_end(dlh, ioc.ioc_coh, rc); out: - D_DEBUG(DB_IO, "Handled collective query RPC %p %s forwarding for obj "DF_UOID - " on rank %u XS %u/%u epc "DF_X64" pmv %u, with dti "DF_DTI", dct_nr %u, " - "forward width %u, forward depth %u\n: "DF_RC"\n", rpc, - ocqi->ocqi_tgts.ca_count <= 1 ? "without" : "with", DP_UOID(ocqi->ocqi_oid), - myrank, dmi->dmi_xs_id, tgt_id, ocqi->ocqi_epoch, ocqi->ocqi_map_ver, + D_DEBUG(DB_IO, + "Handled collective query RPC %p:%s %s forwarding for obj " DF_UOID + " on rank %u XS %u/%u epc " DF_X64 " pmv %u, with dti " DF_DTI ", dct_nr %u, " + "forward width %u, forward depth %u\n: " DF_RC "\n", + rpc, crt_rpc_get_origin_addr(rpc), + ocqi->ocqi_tgts.ca_count <= 1 ? "without" : "with", DP_UOID(ocqi->ocqi_oid), myrank, + dmi->dmi_xs_id, tgt_id, ocqi->ocqi_epoch, ocqi->ocqi_map_ver, DP_DTI(&ocqi->ocqi_xid), (unsigned int)ocqi->ocqi_tgts.ca_count, ocqi->ocqi_disp_width, ocqi->ocqi_disp_depth, DP_RC(rc)); From f7bf07872354b49ede33fa57e851dceba5a44d7c Mon Sep 17 00:00:00 2001 From: Di Wang Date: Fri, 31 Jan 2025 22:19:16 +0000 Subject: [PATCH 2/4] DAOS-16971 cart: fix mem leak fix mem leak Signed-off-by: Di Wang --- src/cart/crt_rpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cart/crt_rpc.c b/src/cart/crt_rpc.c index e94c9efe108..15b5d5e3cb7 100644 --- a/src/cart/crt_rpc.c +++ b/src/cart/crt_rpc.c @@ -574,14 +574,14 @@ crt_rpc_priv_free(struct crt_rpc_priv *rpc_priv) if (rpc_priv->crp_uri_free != 0) D_FREE(rpc_priv->crp_tgt_uri); - if (rpc_priv->crp_orig_uri != NULL) - D_FREE(rpc_priv->crp_orig_uri); - D_MUTEX_DESTROY(&rpc_priv->crp_mutex); D_SPIN_DESTROY(&rpc_priv->crp_lock); RPC_TRACE(DB_TRACE, rpc_priv, "destroying\n"); + if (rpc_priv->crp_orig_uri != NULL) + D_FREE(rpc_priv->crp_orig_uri); + D_FREE(rpc_priv); } From a5a543730ec617cadd2fdbb66c0f7609a7f7be47 Mon Sep 17 00:00:00 2001 From: Di Wang Date: Sat, 1 Feb 2025 02:11:05 +0000 Subject: [PATCH 3/4] DAOS-16971 object: revert some message Revert some log changes to please CI Signed-off-by: Di Wang --- src/object/srv_obj.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/object/srv_obj.c b/src/object/srv_obj.c index 7498d591004..a8dde5930d6 100644 --- a/src/object/srv_obj.c +++ b/src/object/srv_obj.c @@ -184,10 +184,8 @@ obj_rw_reply(crt_rpc_t *rpc, int status, uint64_t epoch, bool release_input, orwo->orw_epoch = max(epoch, orwo->orw_epoch); } - DL_CDEBUG(status == 0 || obj_retry_error(status), DB_IO, DLOG_ERR, status, - "rpc %p:%s opc %d send reply, pmv %d, epoch " DF_X64 ", status %d\n", rpc, - crt_rpc_get_origin_addr(rpc), opc_get(rpc->cr_opc), ioc->ioc_map_ver, - orwo->orw_epoch, status); + D_DEBUG(DB_IO, "rpc %p opc %d send reply, pmv %d, epoch " DF_X64 ", status %d\n", rpc, + opc_get(rpc->cr_opc), ioc->ioc_map_ver, orwo->orw_epoch, status); if (!ioc->ioc_lost_reply) { if (release_input) From c9b8edd43e6d447964dfbd4dd8d32b5ebc7d259c Mon Sep 17 00:00:00 2001 From: Di Wang Date: Sat, 1 Feb 2025 18:21:40 +0000 Subject: [PATCH 4/4] DAOS-16971 cart: fix style fix style Signed-off-by: Di Wang --- src/cart/crt_bulk.c | 6 +++--- src/cart/crt_hg.c | 2 +- src/cart/crt_internal.h | 6 +++--- src/cart/crt_rpc.c | 2 +- src/include/cart/api.h | 2 +- src/object/srv_obj.c | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/cart/crt_bulk.c b/src/cart/crt_bulk.c index 13723634a8f..33532a8c98d 100644 --- a/src/cart/crt_bulk.c +++ b/src/cart/crt_bulk.c @@ -185,7 +185,7 @@ crt_bulk_transfer(struct crt_bulk_desc *bulk_desc, crt_bulk_cb_t complete_cb, rc = crt_hg_bulk_transfer(bulk_desc, complete_cb, arg, opid, false); if (rc != 0) DL_ERROR(rc, "%p:%s crt_hg_bulk_transfer() failed", bulk_desc->bd_rpc, - crt_rpc_get_origin_addr(bulk_desc->bd_rpc)); + crt_req_origin_addr_get(bulk_desc->bd_rpc)); out: return rc; @@ -205,8 +205,8 @@ crt_bulk_bind_transfer(struct crt_bulk_desc *bulk_desc, rc = crt_hg_bulk_transfer(bulk_desc, complete_cb, arg, opid, true); if (rc != 0) - DL_ERROR(rc, "%p:%s crt_hg_bulk_transfer() failed.\n", bulk_desc->bd_rpc, - crt_rpc_get_origin_addr(bulk_desc->bd_rpc)); + DL_ERROR(rc, "%p:%s crt_hg_bulk_transfer() failed.", bulk_desc->bd_rpc, + crt_req_origin_addr_get(bulk_desc->bd_rpc)); out: return rc; diff --git a/src/cart/crt_hg.c b/src/cart/crt_hg.c index 7ffaac03546..4d95a6d7502 100644 --- a/src/cart/crt_hg.c +++ b/src/cart/crt_hg.c @@ -1875,7 +1875,7 @@ crt_hg_bulk_transfer(struct crt_bulk_desc *bulk_desc, crt_bulk_cb_t complete_cb, } char * -crt_rpc_get_origin_addr(crt_rpc_t *rpc_pub) +crt_req_origin_addr_get(crt_rpc_t *rpc_pub) { struct crt_rpc_priv *rpc_priv; diff --git a/src/cart/crt_internal.h b/src/cart/crt_internal.h index 0d7e2d0a660..e49f184627e 100644 --- a/src/cart/crt_internal.h +++ b/src/cart/crt_internal.h @@ -41,15 +41,15 @@ crt_rpc_priv_get_origin_addr(struct crt_rpc_priv *rpc_priv) hg_info = HG_Get_info(rpc_priv->crp_hg_hdl); if (hg_info == NULL) - return "None"; + return "NOINFO"; rc = HG_Addr_to_string(hg_info->hg_class, addr, (hg_size_t *)&addr_size, hg_info->addr); if (rc != 0) - return "None"; + return "NONE"; D_ALLOC(rpc_priv->crp_orig_uri, addr_size); if (rpc_priv->crp_orig_uri == NULL) - return "None"; + return "NOMEM"; memcpy(rpc_priv->crp_orig_uri, addr, addr_size); diff --git a/src/cart/crt_rpc.c b/src/cart/crt_rpc.c index 15b5d5e3cb7..af5316e92f5 100644 --- a/src/cart/crt_rpc.c +++ b/src/cart/crt_rpc.c @@ -1596,7 +1596,7 @@ crt_reply_send(crt_rpc_t *req) rc = crt_hg_reply_send(rpc_priv); if (rc != 0) D_ERROR("crt_hg_reply_send failed, rc: %d,opc: %#x.: %s\n", rc, - rpc_priv->crp_pub.cr_opc, crt_rpc_get_origin_addr(req)); + rpc_priv->crp_pub.cr_opc, crt_req_origin_addr_get(req)); } rpc_priv->crp_reply_pending = 0; diff --git a/src/include/cart/api.h b/src/include/cart/api.h index a8ef4763cae..7428fff3a4f 100644 --- a/src/include/cart/api.h +++ b/src/include/cart/api.h @@ -2353,7 +2353,7 @@ crt_req_get_proto_ver(crt_rpc_t *req); * \return the origin address of the RPC */ char * -crt_rpc_get_origin_addr(crt_rpc_t *rpc); +crt_req_origin_addr_get(crt_rpc_t *rpc); /** @} */ diff --git a/src/object/srv_obj.c b/src/object/srv_obj.c index a8dde5930d6..ab56c68e9ce 100644 --- a/src/object/srv_obj.c +++ b/src/object/srv_obj.c @@ -246,7 +246,7 @@ obj_bulk_comp_cb(const struct crt_bulk_cb_info *cb_info) rpc = bulk_desc->bd_rpc; if (cb_info->bci_rc != 0) - D_ERROR("rpc: %p:%s bulk transfer failed: %d\n", rpc, crt_rpc_get_origin_addr(rpc), + D_ERROR("rpc: %p:%s bulk transfer failed: %d\n", rpc, crt_req_origin_addr_get(rpc), cb_info->bci_rc); arg = (struct obj_bulk_args *)cb_info->bci_arg; @@ -5840,7 +5840,7 @@ ds_obj_coll_punch_handler(crt_rpc_t *rpc) (ocpi->ocpi_flags & ORF_LEADER) ? "leader" : (ocpi->ocpi_tgts.ca_count == 1 ? "non-leader" : "relay-engine"), - rpc, crt_rpc_get_origin_addr(rpc), DP_UOID(ocpi->ocpi_oid), dmi->dmi_xs_id, + rpc, crt_req_origin_addr_get(rpc), DP_UOID(ocpi->ocpi_oid), dmi->dmi_xs_id, dmi->dmi_tgt_id, DP_UUID(ocpi->ocpi_po_uuid), DP_UUID(ocpi->ocpi_co_hdl), DP_UUID(ocpi->ocpi_co_uuid), ocpi->ocpi_epoch, ocpi->ocpi_map_ver, max_ver, DP_DTI(&ocpi->ocpi_xid), ocpi->ocpi_bulk_tgt_sz, ocpi->ocpi_bulk_tgt_nr, @@ -5981,7 +5981,7 @@ ds_obj_coll_query_handler(crt_rpc_t *rpc) "Handled collective query RPC %p:%s %s forwarding for obj " DF_UOID " on rank %u XS %u/%u epc " DF_X64 " pmv %u, with dti " DF_DTI ", dct_nr %u, " "forward width %u, forward depth %u\n: " DF_RC "\n", - rpc, crt_rpc_get_origin_addr(rpc), + rpc, crt_req_origin_addr_get(rpc), ocqi->ocqi_tgts.ca_count <= 1 ? "without" : "with", DP_UOID(ocqi->ocqi_oid), myrank, dmi->dmi_xs_id, tgt_id, ocqi->ocqi_epoch, ocqi->ocqi_map_ver, DP_DTI(&ocqi->ocqi_xid), (unsigned int)ocqi->ocqi_tgts.ca_count,