SUNRPC: Trace xprt_timer events
authorChuck Lever <chuck.lever@oracle.com>
Wed, 3 Jan 2018 20:38:25 +0000 (15:38 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 23 Jan 2018 14:44:39 +0000 (09:44 -0500)
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>
include/trace/events/sunrpc.h
net/sunrpc/xprt.c
net/sunrpc/xprtrdma/transport.c

index 8c153f68509e297225db7614f8e706479476bb9c..7804d857fd24ac0e563462c99d010f2253b02f5a 100644 (file)
@@ -390,6 +390,10 @@ DECLARE_EVENT_CLASS(rpc_xprt_event,
                        __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,
        TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
        TP_ARGS(xprt, xid, status));
index 33b74fd8405185d906d07e315c9b5a83775e747d..2436fd1125fc608067dcc7a7bc52b9ebb690ae48 100644 (file)
@@ -940,8 +940,8 @@ static void xprt_timer(struct rpc_task *task)
 
        if (task->tk_status != -ETIMEDOUT)
                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 (xprt->ops->timer)
                        xprt->ops->timer(xprt, task);
index b90179af88bf4d489062a492871ae55245bd32c2..4b1ecfe979cf4d5b0df54679fdd127f7b24847f8 100644 (file)
@@ -516,8 +516,6 @@ xprt_rdma_set_port(struct rpc_xprt *xprt, u16 port)
 static void
 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);
 }