|
11 | 11 | #define _TRACE_RPCRDMA_H
|
12 | 12 |
|
13 | 13 | #include <linux/scatterlist.h>
|
| 14 | +#include <linux/sunrpc/rpc_rdma_cid.h> |
14 | 15 | #include <linux/tracepoint.h>
|
15 | 16 | #include <trace/events/rdma.h>
|
16 | 17 |
|
17 | 18 | /**
|
18 | 19 | ** Event classes
|
19 | 20 | **/
|
20 | 21 |
|
| 22 | +DECLARE_EVENT_CLASS(rpcrdma_completion_class, |
| 23 | + TP_PROTO( |
| 24 | + const struct ib_wc *wc, |
| 25 | + const struct rpc_rdma_cid *cid |
| 26 | + ), |
| 27 | + |
| 28 | + TP_ARGS(wc, cid), |
| 29 | + |
| 30 | + TP_STRUCT__entry( |
| 31 | + __field(u32, cq_id) |
| 32 | + __field(int, completion_id) |
| 33 | + __field(unsigned long, status) |
| 34 | + __field(unsigned int, vendor_err) |
| 35 | + ), |
| 36 | + |
| 37 | + TP_fast_assign( |
| 38 | + __entry->cq_id = cid->ci_queue_id; |
| 39 | + __entry->completion_id = cid->ci_completion_id; |
| 40 | + __entry->status = wc->status; |
| 41 | + if (wc->status) |
| 42 | + __entry->vendor_err = wc->vendor_err; |
| 43 | + else |
| 44 | + __entry->vendor_err = 0; |
| 45 | + ), |
| 46 | + |
| 47 | + TP_printk("cq.id=%u cid=%d status=%s (%lu/0x%x)", |
| 48 | + __entry->cq_id, __entry->completion_id, |
| 49 | + rdma_show_wc_status(__entry->status), |
| 50 | + __entry->status, __entry->vendor_err |
| 51 | + ) |
| 52 | +); |
| 53 | + |
| 54 | +#define DEFINE_COMPLETION_EVENT(name) \ |
| 55 | + DEFINE_EVENT(rpcrdma_completion_class, name, \ |
| 56 | + TP_PROTO( \ |
| 57 | + const struct ib_wc *wc, \ |
| 58 | + const struct rpc_rdma_cid *cid \ |
| 59 | + ), \ |
| 60 | + TP_ARGS(wc, cid)) |
| 61 | + |
| 62 | +DEFINE_COMPLETION_EVENT(dummy); |
| 63 | + |
21 | 64 | DECLARE_EVENT_CLASS(xprtrdma_reply_event,
|
22 | 65 | TP_PROTO(
|
23 | 66 | const struct rpcrdma_rep *rep
|
|
0 commit comments