From f4e3aeabd5e2ac33c61977a7150b344b9d85ce83 Mon Sep 17 00:00:00 2001 From: Shi Jin Date: Mon, 25 Nov 2024 21:54:56 +0000 Subject: [PATCH] prov/efa: Add tracepoint for poll cq ope This tracepoint records the event when a polled cqe has an associated op entry already, which is expected for send, RMA, and zero-copy receive operations. Signed-off-by: Shi Jin --- prov/efa/src/rdm/efa_rdm_cq.c | 3 +++ prov/efa/src/rdm/efa_rdm_tracepoint.h | 15 +++++++++++++++ prov/efa/src/rdm/efa_rdm_tracepoint_def.h | 5 +++++ 3 files changed, 23 insertions(+) diff --git a/prov/efa/src/rdm/efa_rdm_cq.c b/prov/efa/src/rdm/efa_rdm_cq.c index 4b3bcd74d1d..987332a6af7 100644 --- a/prov/efa/src/rdm/efa_rdm_cq.c +++ b/prov/efa/src/rdm/efa_rdm_cq.c @@ -475,7 +475,10 @@ void efa_rdm_cq_poll_ibv_cq(ssize_t cqe_to_process, struct efa_ibv_cq *ibv_cq) pkt_entry = (void *)(uintptr_t)ibv_cq->ibv_cq_ex->wr_id; qp = efa_domain->qp_table[ibv_wc_read_qp_num(ibv_cq->ibv_cq_ex) & efa_domain->qp_table_sz_m1]; ep = container_of(qp->base_ep, struct efa_rdm_ep, base_ep); +#if HAVE_LTTNG efa_rdm_tracepoint(poll_cq, (size_t) ibv_cq->ibv_cq_ex->wr_id); + efa_rdm_tracepoint_poll_cq_ope(ibv_cq->ibv_cq_ex->wr_id); +#endif opcode = ibv_wc_read_opcode(ibv_cq->ibv_cq_ex); if (ibv_cq->ibv_cq_ex->status) { prov_errno = efa_rdm_cq_get_prov_errno(ibv_cq->ibv_cq_ex); diff --git a/prov/efa/src/rdm/efa_rdm_tracepoint.h b/prov/efa/src/rdm/efa_rdm_tracepoint.h index 3959bc8f2af..29b112d0568 100644 --- a/prov/efa/src/rdm/efa_rdm_tracepoint.h +++ b/prov/efa/src/rdm/efa_rdm_tracepoint.h @@ -25,6 +25,21 @@ /* tracelog() is similar to tracef(), but with a log level param */ #define efa_rdm_tracelog lttng_ust_tracelog +static inline void efa_rdm_tracepoint_poll_cq_ope(const size_t wr_id) +{ + struct efa_rdm_pke *pkt_entry = (struct efa_rdm_pke *) wr_id; + struct efa_rdm_ope *ope; + + if (!pkt_entry || !(pkt_entry->ope)) + return; + + assert(pkt_entry && pkt_entry->ope); + ope = pkt_entry->ope; + + efa_rdm_tracepoint(poll_cq_ope, ope->msg_id, (size_t) ope->cq_entry.op_context, + ope->total_len, ope->cq_entry.tag, ope->addr); +} + #else #define efa_rdm_tracepoint(...) do {} while (0) diff --git a/prov/efa/src/rdm/efa_rdm_tracepoint_def.h b/prov/efa/src/rdm/efa_rdm_tracepoint_def.h index 6e2fab54b7f..b814e957372 100644 --- a/prov/efa/src/rdm/efa_rdm_tracepoint_def.h +++ b/prov/efa/src/rdm/efa_rdm_tracepoint_def.h @@ -109,6 +109,11 @@ LTTNG_UST_TRACEPOINT_EVENT_CLASS(EFA_RDM_TP_PROV, x_entry_cq_entry, LTTNG_UST_TP_ARGS(X_ENTRY_ARGS, CQ_ENTRY_ARGS), LTTNG_UST_TP_FIELDS(X_ENTRY_FIELDS CQ_ENTRY_FIELDS)) +LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(EFA_RDM_TP_PROV, x_entry_cq_entry, EFA_RDM_TP_PROV, + poll_cq_ope, + LTTNG_UST_TP_ARGS(X_ENTRY_ARGS, CQ_ENTRY_ARGS)) +LTTNG_UST_TRACEPOINT_LOGLEVEL(EFA_RDM_TP_PROV, poll_cq_ope, LTTNG_UST_TRACEPOINT_LOGLEVEL_INFO) + LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(EFA_RDM_TP_PROV, x_entry_cq_entry, EFA_RDM_TP_PROV, send_end, LTTNG_UST_TP_ARGS(X_ENTRY_ARGS, CQ_ENTRY_ARGS))