diff --git a/src/uct/ib/rc/base/rc_ep.h b/src/uct/ib/rc/base/rc_ep.h index dcfbe0071d8..6ea5fbcec6a 100644 --- a/src/uct/ib/rc/base/rc_ep.h +++ b/src/uct/ib/rc/base/rc_ep.h @@ -362,6 +362,7 @@ uct_rc_txqp_add_flush_comp(uct_rc_iface_t *iface, uct_base_ep_t *ep, op->flags = 0; op->user_comp = comp; + uct_rc_iface_send_op_set_name(op, "rc_txqp_add_flush_comp"); uct_rc_txqp_add_send_op_sn(txqp, op, sn); VALGRIND_MAKE_MEM_DEFINED(op, sizeof(*op)); /* handler set by mpool init */ } diff --git a/src/uct/ib/rc/base/rc_iface.c b/src/uct/ib/rc/base/rc_iface.c index c175755368c..5bd325298eb 100644 --- a/src/uct/ib/rc/base/rc_iface.c +++ b/src/uct/ib/rc/base/rc_iface.c @@ -159,12 +159,17 @@ uct_rc_iface_flush_comp_init(ucs_mpool_t *mp, void *obj, void *chunk) op->iface = iface; } + +static void ucp_send_op_mpool_obj_str(ucs_mpool_t *mp, void *obj, + ucs_string_buffer_t *strb); + + static ucs_mpool_ops_t uct_rc_flush_comp_mpool_ops = { .chunk_alloc = ucs_mpool_chunk_malloc, .chunk_release = ucs_mpool_chunk_free, .obj_init = uct_rc_iface_flush_comp_init, .obj_cleanup = NULL, - .obj_str = NULL + .obj_str = ucp_send_op_mpool_obj_str }; ucs_status_t uct_rc_iface_query(uct_rc_iface_t *iface, @@ -953,3 +958,24 @@ ucs_status_t uct_rc_iface_fence(uct_iface_h tl_iface, unsigned flags) UCT_TL_IFACE_STAT_FENCE(&iface->super.super); return UCS_OK; } + +static void ucp_send_op_mpool_obj_str(ucs_mpool_t *mp, void *obj, + ucs_string_buffer_t *strb) +{ + uct_rc_iface_send_op_t *op = obj; + const char *handler_func_name = ucs_debug_get_symbol_name(op->handler); + const char *comp_func_name; + + ucs_string_buffer_appendf(strb, "flags:0x%x handler:%s()", op->flags, + handler_func_name); + + if (op->user_comp != NULL) { + comp_func_name = ucs_debug_get_symbol_name(op->user_comp->func); + ucs_string_buffer_appendf(strb, " comp:%s()", comp_func_name); + } + +#if ENABLE_DEBUG_DATA + ucs_string_buffer_appendf(strb, " name:%s", op->name); +#endif +} + diff --git a/src/uct/ib/rc/base/rc_iface.h b/src/uct/ib/rc/base/rc_iface.h index f37b1cbf2a6..625816688ff 100644 --- a/src/uct/ib/rc/base/rc_iface.h +++ b/src/uct/ib/rc/base/rc_iface.h @@ -294,6 +294,9 @@ struct uct_rc_iface_send_op { get_bcopy completions */ }; uct_completion_t *user_comp; +#if ENABLE_DEBUG_DATA + const char *name; /* object ID, debug only */ +#endif }; @@ -473,4 +476,13 @@ uct_rc_iface_atomic_handler(uct_rc_iface_t *iface, int ext, unsigned length) } return NULL; } + +static UCS_F_ALWAYS_INLINE void +uct_rc_iface_send_op_set_name(uct_rc_iface_send_op_t *op, const char *name) +{ +#if ENABLE_DEBUG_DATA + op->name = name; +#endif +} + #endif