xprtrdma: Clean up Receive trace points

For clarity, report the posting and completion of Receive CQEs.

Also, the wc->byte_len field contains garbage if wc->status is
non-zero, and the vendor error field contains garbage if wc->status
is zero. For readability, don't save those fields in those cases.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Chuck Lever 2018-05-04 15:35:14 -04:00 committed by Anna Schumaker
parent edb41e61a5
commit 0e0b854cfb
2 changed files with 22 additions and 21 deletions

View File

@ -528,24 +528,21 @@ TRACE_EVENT(xprtrdma_post_send,
TRACE_EVENT(xprtrdma_post_recv,
TP_PROTO(
const struct rpcrdma_rep *rep,
int status
const struct ib_cqe *cqe
),
TP_ARGS(rep, status),
TP_ARGS(cqe),
TP_STRUCT__entry(
__field(const void *, rep)
__field(int, status)
__field(const void *, cqe)
),
TP_fast_assign(
__entry->rep = rep;
__entry->status = status;
__entry->cqe = cqe;
),
TP_printk("rep=%p status=%d",
__entry->rep, __entry->status
TP_printk("cqe=%p",
__entry->cqe
)
);
@ -584,28 +581,32 @@ TRACE_EVENT(xprtrdma_wc_send,
TRACE_EVENT(xprtrdma_wc_receive,
TP_PROTO(
const struct rpcrdma_rep *rep,
const struct ib_wc *wc
),
TP_ARGS(rep, wc),
TP_ARGS(wc),
TP_STRUCT__entry(
__field(const void *, rep)
__field(unsigned int, byte_len)
__field(const void *, cqe)
__field(u32, byte_len)
__field(unsigned int, status)
__field(unsigned int, vendor_err)
__field(u32, vendor_err)
),
TP_fast_assign(
__entry->rep = rep;
__entry->byte_len = wc->byte_len;
__entry->cqe = wc->wr_cqe;
__entry->status = wc->status;
__entry->vendor_err = __entry->status ? wc->vendor_err : 0;
if (wc->status) {
__entry->byte_len = 0;
__entry->vendor_err = wc->vendor_err;
} else {
__entry->byte_len = wc->byte_len;
__entry->vendor_err = 0;
}
),
TP_printk("rep=%p, %u bytes: %s (%u/0x%x)",
__entry->rep, __entry->byte_len,
TP_printk("cqe=%p %u bytes: %s (%u/0x%x)",
__entry->cqe, __entry->byte_len,
rdma_show_wc_status(__entry->status),
__entry->status, __entry->vendor_err
)

View File

@ -160,7 +160,7 @@ rpcrdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc)
rr_cqe);
/* WARNING: Only wr_id and status are reliable at this point */
trace_xprtrdma_wc_receive(rep, wc);
trace_xprtrdma_wc_receive(wc);
if (wc->status != IB_WC_SUCCESS)
goto out_fail;
@ -1570,7 +1570,7 @@ rpcrdma_ep_post_recv(struct rpcrdma_ia *ia,
if (!rpcrdma_dma_map_regbuf(ia, rep->rr_rdmabuf))
goto out_map;
rc = ib_post_recv(ia->ri_id->qp, &rep->rr_recv_wr, &recv_wr_fail);
trace_xprtrdma_post_recv(rep, rc);
trace_xprtrdma_post_recv(rep->rr_recv_wr.wr_cqe);
if (rc)
return -ENOTCONN;
return 0;