xprtrdma: Add trace points to instrument QP and CQ access upcalls
authorChuck Lever <chuck.lever@oracle.com>
Wed, 20 Dec 2017 21:31:45 +0000 (16:31 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 23 Jan 2018 14:44:38 +0000 (09:44 -0500)
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
include/trace/events/rpcrdma.h
net/sunrpc/xprtrdma/verbs.c

index 95c2c0bffb65faa204a8edaa7365c62b91591f7d..1e5ae57a4f0d8bf54f62168328348915456a9e84 100644 (file)
@@ -375,6 +375,37 @@ DEFINE_RXPRT_EVENT(xprtrdma_reinsert);
 DEFINE_RXPRT_EVENT(xprtrdma_reconnect);
 DEFINE_RXPRT_EVENT(xprtrdma_inject_dsc);
 
+TRACE_EVENT(xprtrdma_qp_error,
+       TP_PROTO(
+               const struct rpcrdma_xprt *r_xprt,
+               const struct ib_event *event
+       ),
+
+       TP_ARGS(r_xprt, event),
+
+       TP_STRUCT__entry(
+               __field(const void *, r_xprt)
+               __field(unsigned int, event)
+               __string(name, event->device->name)
+               __string(addr, rpcrdma_addrstr(r_xprt))
+               __string(port, rpcrdma_portstr(r_xprt))
+       ),
+
+       TP_fast_assign(
+               __entry->r_xprt = r_xprt;
+               __entry->event = event->event;
+               __assign_str(name, event->device->name);
+               __assign_str(addr, rpcrdma_addrstr(r_xprt));
+               __assign_str(port, rpcrdma_portstr(r_xprt));
+       ),
+
+       TP_printk("peer=[%s]:%s r_xprt=%p: dev %s: %s (%u)",
+               __get_str(addr), __get_str(port), __entry->r_xprt,
+               __get_str(name), rdma_show_ib_event(__entry->event),
+               __entry->event
+       )
+);
+
 /**
  ** Call events
  **/
index 7f9e9025c42f2fbeffb736ffa0e3e34eb9e0c67c..fb81d3a4b0b34a82cb821a9c5c8554f149208e14 100644 (file)
@@ -108,7 +108,10 @@ static void
 rpcrdma_qp_async_error_upcall(struct ib_event *event, void *context)
 {
        struct rpcrdma_ep *ep = context;
+       struct rpcrdma_xprt *r_xprt = container_of(ep, struct rpcrdma_xprt,
+                                                  rx_ep);
 
+       trace_xprtrdma_qp_error(r_xprt, event);
        pr_err("rpcrdma: %s on device %s ep %p\n",
               ib_event_msg(event->event), event->device->name, context);