Browse Source

SUNRPC: Trace xprt_timer events

Track RPC timeouts: report the XID and the server address to match
the content of network capture.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Chuck Lever 7 years ago
parent
commit
82476d9f95
3 changed files with 5 additions and 3 deletions
  1. 4 0
      include/trace/events/sunrpc.h
  2. 1 1
      net/sunrpc/xprt.c
  3. 0 2
      net/sunrpc/xprtrdma/transport.c

+ 4 - 0
include/trace/events/sunrpc.h

@@ -390,6 +390,10 @@ DECLARE_EVENT_CLASS(rpc_xprt_event,
 			__entry->status)
 			__entry->status)
 );
 );
 
 
+DEFINE_EVENT(rpc_xprt_event, xprt_timer,
+	TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
+	TP_ARGS(xprt, xid, status));
+
 DEFINE_EVENT(rpc_xprt_event, xprt_lookup_rqst,
 DEFINE_EVENT(rpc_xprt_event, xprt_lookup_rqst,
 	TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
 	TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
 	TP_ARGS(xprt, xid, status));
 	TP_ARGS(xprt, xid, status));

+ 1 - 1
net/sunrpc/xprt.c

@@ -940,8 +940,8 @@ static void xprt_timer(struct rpc_task *task)
 
 
 	if (task->tk_status != -ETIMEDOUT)
 	if (task->tk_status != -ETIMEDOUT)
 		return;
 		return;
-	dprintk("RPC: %5u xprt_timer\n", task->tk_pid);
 
 
+	trace_xprt_timer(xprt, req->rq_xid, task->tk_status);
 	if (!req->rq_reply_bytes_recvd) {
 	if (!req->rq_reply_bytes_recvd) {
 		if (xprt->ops->timer)
 		if (xprt->ops->timer)
 			xprt->ops->timer(xprt, task);
 			xprt->ops->timer(xprt, task);

+ 0 - 2
net/sunrpc/xprtrdma/transport.c

@@ -516,8 +516,6 @@ xprt_rdma_set_port(struct rpc_xprt *xprt, u16 port)
 static void
 static void
 xprt_rdma_timer(struct rpc_xprt *xprt, struct rpc_task *task)
 xprt_rdma_timer(struct rpc_xprt *xprt, struct rpc_task *task)
 {
 {
-	dprintk("RPC: %5u %s: xprt = %p\n", task->tk_pid, __func__, xprt);
-
 	xprt_force_disconnect(xprt);
 	xprt_force_disconnect(xprt);
 }
 }