static void fi_tostr_domain_attr(char *buf, const struct fi_domain_attr *attr, const char *prefix) { if (!attr) { strcatf(buf, "%sfi_domain_attr: (null)\n", prefix); return; } strcatf(buf, "%sfi_domain_attr:\n", prefix); strcatf(buf, "%s%sname: %s\n", prefix, TAB, attr->name); strcatf(buf, "%s%sthreading: ", prefix, TAB); fi_tostr_threading(buf, attr->threading); strcatf(buf, "\n"); strcatf(buf, "%s%scontrol_progress: ", prefix,TAB); fi_tostr_progress(buf, attr->control_progress); strcatf(buf, "\n"); strcatf(buf, "%s%sdata_progress: ", prefix, TAB); fi_tostr_progress(buf, attr->data_progress); strcatf(buf, "\n"); strcatf(buf, "%s%smr_key_size: %zd\n", prefix, TAB, attr->mr_key_size); strcatf(buf, "%s%scq_data_size: %zd\n", prefix, TAB, attr->cq_data_size); strcatf(buf, "%s%sep_cnt: %zd\n", prefix, TAB, attr->ep_cnt); strcatf(buf, "%s%stx_ctx_cnt: %zd\n", prefix, TAB, attr->tx_ctx_cnt); strcatf(buf, "%s%srx_ctx_cnt: %zd\n", prefix, TAB, attr->rx_ctx_cnt); strcatf(buf, "%s%smax_ep_tx_ctx: %zd\n", prefix, TAB, attr->max_ep_tx_ctx); strcatf(buf, "%s%smax_ep_rx_ctx: %zd\n", prefix, TAB, attr->max_ep_rx_ctx); }
static void fi_tostr_domain_attr(char *buf, const struct fi_domain_attr *attr, const char *prefix) { if (!attr) { strcatf(buf, "%sfi_domain_attr: (null)\n", prefix); return; } strcatf(buf, "%sfi_domain_attr:\n", prefix); strcatf(buf, "%s%sdomain: 0x%x\n", prefix, TAB, attr->domain); strcatf(buf, "%s%sname: %s\n", prefix, TAB, attr->name); strcatf(buf, "%s%sthreading: ", prefix, TAB); fi_tostr_threading(buf, attr->threading); strcatf(buf, "\n"); strcatf(buf, "%s%scontrol_progress: ", prefix,TAB); fi_tostr_progress(buf, attr->control_progress); strcatf(buf, "\n"); strcatf(buf, "%s%sdata_progress: ", prefix, TAB); fi_tostr_progress(buf, attr->data_progress); strcatf(buf, "\n"); strcatf(buf, "%s%sresource_mgmt: ", prefix, TAB); fi_tostr_resource_mgmt(buf, attr->resource_mgmt); strcatf(buf, "\n"); strcatf(buf, "%s%sav_type: ", prefix, TAB); fi_tostr_av_type(buf, attr->av_type); strcatf(buf, "\n"); strcatf(buf, "%s%smr_mode: [ ", prefix, TAB); fi_tostr_mr_mode(buf, attr->mr_mode); strcatf(buf, " ]\n"); strcatf(buf, "%s%smr_key_size: %zd\n", prefix, TAB, attr->mr_key_size); strcatf(buf, "%s%scq_data_size: %zd\n", prefix, TAB, attr->cq_data_size); strcatf(buf, "%s%scq_cnt: %zd\n", prefix, TAB, attr->cq_cnt); strcatf(buf, "%s%sep_cnt: %zd\n", prefix, TAB, attr->ep_cnt); strcatf(buf, "%s%stx_ctx_cnt: %zd\n", prefix, TAB, attr->tx_ctx_cnt); strcatf(buf, "%s%srx_ctx_cnt: %zd\n", prefix, TAB, attr->rx_ctx_cnt); strcatf(buf, "%s%smax_ep_tx_ctx: %zd\n", prefix, TAB, attr->max_ep_tx_ctx); strcatf(buf, "%s%smax_ep_rx_ctx: %zd\n", prefix, TAB, attr->max_ep_rx_ctx); strcatf(buf, "%s%smax_ep_stx_ctx: %zd\n", prefix, TAB, attr->max_ep_stx_ctx); strcatf(buf, "%s%smax_ep_srx_ctx: %zd\n", prefix, TAB, attr->max_ep_srx_ctx); strcatf(buf, "%s%scntr_cnt: %zd\n", prefix, TAB, attr->cntr_cnt); }
char *DEFAULT_SYMVER_PRE(fi_tostr)(const void *data, enum fi_type datatype) { static char *buf = NULL; uint64_t val64 = *(const uint64_t *) data; uint32_t val32 = *(const uint32_t *) data; int enumval = *(const int *) data; if (!data) return NULL; if (!buf) { buf = calloc(BUFSIZ, 1); if (!buf) return NULL; } buf[0] = '\0'; switch (datatype) { case FI_TYPE_INFO: fi_tostr_info(buf, data); break; case FI_TYPE_EP_TYPE: fi_tostr_ep_type(buf, enumval); break; case FI_TYPE_CAPS: fi_tostr_caps(buf, val64); break; case FI_TYPE_OP_FLAGS: fi_tostr_flags(buf, val64); break; case FI_TYPE_ADDR_FORMAT: fi_tostr_addr_format(buf, val32); break; case FI_TYPE_TX_ATTR: fi_tostr_tx_attr(buf, data, ""); break; case FI_TYPE_RX_ATTR: fi_tostr_rx_attr(buf, data, ""); break; case FI_TYPE_EP_ATTR: fi_tostr_ep_attr(buf, data, ""); break; case FI_TYPE_DOMAIN_ATTR: fi_tostr_domain_attr(buf, data, ""); break; case FI_TYPE_FABRIC_ATTR: fi_tostr_fabric_attr(buf, data, ""); break; case FI_TYPE_THREADING: fi_tostr_threading(buf, enumval); break; case FI_TYPE_PROGRESS: fi_tostr_progress(buf, enumval); break; case FI_TYPE_PROTOCOL: fi_tostr_protocol(buf, val32); break; case FI_TYPE_MSG_ORDER: fi_tostr_order(buf, val64); break; case FI_TYPE_MODE: fi_tostr_mode(buf, val64); break; case FI_TYPE_AV_TYPE: fi_tostr_av_type(buf, enumval); break; case FI_TYPE_ATOMIC_TYPE: fi_tostr_atomic_type(buf, enumval); break; case FI_TYPE_ATOMIC_OP: fi_tostr_atomic_op(buf, enumval); break; case FI_TYPE_VERSION: fi_tostr_version(buf); break; default: strcatf(buf, "Unknown type"); break; } return buf; }