|
@@ -27,58 +27,58 @@
|
|
|
#define PG_DIR_SZ { TARGET_PAGE_SIZE / sizeof(__u64) }
|
|
|
#define PG_TBL_SZ { TARGET_PAGE_SIZE / sizeof(__u64) }
|
|
|
|
|
|
-void rdma_dump_device_counters(Monitor *mon, RdmaDeviceResources *dev_res)
|
|
|
-{
|
|
|
- monitor_printf(mon, "\ttx : %" PRId64 "\n",
|
|
|
- dev_res->stats.tx);
|
|
|
- monitor_printf(mon, "\ttx_len : %" PRId64 "\n",
|
|
|
- dev_res->stats.tx_len);
|
|
|
- monitor_printf(mon, "\ttx_err : %" PRId64 "\n",
|
|
|
- dev_res->stats.tx_err);
|
|
|
- monitor_printf(mon, "\trx_bufs : %" PRId64 "\n",
|
|
|
- dev_res->stats.rx_bufs);
|
|
|
- monitor_printf(mon, "\trx_srq : %" PRId64 "\n",
|
|
|
- dev_res->stats.rx_srq);
|
|
|
- monitor_printf(mon, "\trx_bufs_len : %" PRId64 "\n",
|
|
|
- dev_res->stats.rx_bufs_len);
|
|
|
- monitor_printf(mon, "\trx_bufs_err : %" PRId64 "\n",
|
|
|
- dev_res->stats.rx_bufs_err);
|
|
|
- monitor_printf(mon, "\tcomps : %" PRId64 "\n",
|
|
|
- dev_res->stats.completions);
|
|
|
- monitor_printf(mon, "\tmissing_comps : %" PRId32 "\n",
|
|
|
- dev_res->stats.missing_cqe);
|
|
|
- monitor_printf(mon, "\tpoll_cq (bk) : %" PRId64 "\n",
|
|
|
- dev_res->stats.poll_cq_from_bk);
|
|
|
- monitor_printf(mon, "\tpoll_cq_ppoll_to : %" PRId64 "\n",
|
|
|
- dev_res->stats.poll_cq_ppoll_to);
|
|
|
- monitor_printf(mon, "\tpoll_cq (fe) : %" PRId64 "\n",
|
|
|
- dev_res->stats.poll_cq_from_guest);
|
|
|
- monitor_printf(mon, "\tpoll_cq_empty : %" PRId64 "\n",
|
|
|
- dev_res->stats.poll_cq_from_guest_empty);
|
|
|
- monitor_printf(mon, "\tmad_tx : %" PRId64 "\n",
|
|
|
- dev_res->stats.mad_tx);
|
|
|
- monitor_printf(mon, "\tmad_tx_err : %" PRId64 "\n",
|
|
|
- dev_res->stats.mad_tx_err);
|
|
|
- monitor_printf(mon, "\tmad_rx : %" PRId64 "\n",
|
|
|
- dev_res->stats.mad_rx);
|
|
|
- monitor_printf(mon, "\tmad_rx_err : %" PRId64 "\n",
|
|
|
- dev_res->stats.mad_rx_err);
|
|
|
- monitor_printf(mon, "\tmad_rx_bufs : %" PRId64 "\n",
|
|
|
- dev_res->stats.mad_rx_bufs);
|
|
|
- monitor_printf(mon, "\tmad_rx_bufs_err : %" PRId64 "\n",
|
|
|
- dev_res->stats.mad_rx_bufs_err);
|
|
|
- monitor_printf(mon, "\tPDs : %" PRId32 "\n",
|
|
|
- dev_res->pd_tbl.used);
|
|
|
- monitor_printf(mon, "\tMRs : %" PRId32 "\n",
|
|
|
- dev_res->mr_tbl.used);
|
|
|
- monitor_printf(mon, "\tUCs : %" PRId32 "\n",
|
|
|
- dev_res->uc_tbl.used);
|
|
|
- monitor_printf(mon, "\tQPs : %" PRId32 "\n",
|
|
|
- dev_res->qp_tbl.used);
|
|
|
- monitor_printf(mon, "\tCQs : %" PRId32 "\n",
|
|
|
- dev_res->cq_tbl.used);
|
|
|
- monitor_printf(mon, "\tCEQ_CTXs : %" PRId32 "\n",
|
|
|
- dev_res->cqe_ctx_tbl.used);
|
|
|
+void rdma_format_device_counters(RdmaDeviceResources *dev_res, GString *buf)
|
|
|
+{
|
|
|
+ g_string_append_printf(buf, "\ttx : %" PRId64 "\n",
|
|
|
+ dev_res->stats.tx);
|
|
|
+ g_string_append_printf(buf, "\ttx_len : %" PRId64 "\n",
|
|
|
+ dev_res->stats.tx_len);
|
|
|
+ g_string_append_printf(buf, "\ttx_err : %" PRId64 "\n",
|
|
|
+ dev_res->stats.tx_err);
|
|
|
+ g_string_append_printf(buf, "\trx_bufs : %" PRId64 "\n",
|
|
|
+ dev_res->stats.rx_bufs);
|
|
|
+ g_string_append_printf(buf, "\trx_srq : %" PRId64 "\n",
|
|
|
+ dev_res->stats.rx_srq);
|
|
|
+ g_string_append_printf(buf, "\trx_bufs_len : %" PRId64 "\n",
|
|
|
+ dev_res->stats.rx_bufs_len);
|
|
|
+ g_string_append_printf(buf, "\trx_bufs_err : %" PRId64 "\n",
|
|
|
+ dev_res->stats.rx_bufs_err);
|
|
|
+ g_string_append_printf(buf, "\tcomps : %" PRId64 "\n",
|
|
|
+ dev_res->stats.completions);
|
|
|
+ g_string_append_printf(buf, "\tmissing_comps : %" PRId32 "\n",
|
|
|
+ dev_res->stats.missing_cqe);
|
|
|
+ g_string_append_printf(buf, "\tpoll_cq (bk) : %" PRId64 "\n",
|
|
|
+ dev_res->stats.poll_cq_from_bk);
|
|
|
+ g_string_append_printf(buf, "\tpoll_cq_ppoll_to : %" PRId64 "\n",
|
|
|
+ dev_res->stats.poll_cq_ppoll_to);
|
|
|
+ g_string_append_printf(buf, "\tpoll_cq (fe) : %" PRId64 "\n",
|
|
|
+ dev_res->stats.poll_cq_from_guest);
|
|
|
+ g_string_append_printf(buf, "\tpoll_cq_empty : %" PRId64 "\n",
|
|
|
+ dev_res->stats.poll_cq_from_guest_empty);
|
|
|
+ g_string_append_printf(buf, "\tmad_tx : %" PRId64 "\n",
|
|
|
+ dev_res->stats.mad_tx);
|
|
|
+ g_string_append_printf(buf, "\tmad_tx_err : %" PRId64 "\n",
|
|
|
+ dev_res->stats.mad_tx_err);
|
|
|
+ g_string_append_printf(buf, "\tmad_rx : %" PRId64 "\n",
|
|
|
+ dev_res->stats.mad_rx);
|
|
|
+ g_string_append_printf(buf, "\tmad_rx_err : %" PRId64 "\n",
|
|
|
+ dev_res->stats.mad_rx_err);
|
|
|
+ g_string_append_printf(buf, "\tmad_rx_bufs : %" PRId64 "\n",
|
|
|
+ dev_res->stats.mad_rx_bufs);
|
|
|
+ g_string_append_printf(buf, "\tmad_rx_bufs_err : %" PRId64 "\n",
|
|
|
+ dev_res->stats.mad_rx_bufs_err);
|
|
|
+ g_string_append_printf(buf, "\tPDs : %" PRId32 "\n",
|
|
|
+ dev_res->pd_tbl.used);
|
|
|
+ g_string_append_printf(buf, "\tMRs : %" PRId32 "\n",
|
|
|
+ dev_res->mr_tbl.used);
|
|
|
+ g_string_append_printf(buf, "\tUCs : %" PRId32 "\n",
|
|
|
+ dev_res->uc_tbl.used);
|
|
|
+ g_string_append_printf(buf, "\tQPs : %" PRId32 "\n",
|
|
|
+ dev_res->qp_tbl.used);
|
|
|
+ g_string_append_printf(buf, "\tCQs : %" PRId32 "\n",
|
|
|
+ dev_res->cq_tbl.used);
|
|
|
+ g_string_append_printf(buf, "\tCEQ_CTXs : %" PRId32 "\n",
|
|
|
+ dev_res->cqe_ctx_tbl.used);
|
|
|
}
|
|
|
|
|
|
static inline void res_tbl_init(const char *name, RdmaRmResTbl *tbl,
|