Skip to content

Commit

Permalink
prov/efa: Add tracepoint for poll cq ope
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
shijin-aws committed Nov 25, 2024
1 parent 1af9ddc commit f4e3aea
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions prov/efa/src/rdm/efa_rdm_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions prov/efa/src/rdm/efa_rdm_tracepoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions prov/efa/src/rdm/efa_rdm_tracepoint_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit f4e3aea

Please sign in to comment.