SUNRPC: Add a tracepoint for server socket out-of-space conditions
authorTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 24 Jun 2016 14:55:45 +0000 (10:55 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 13 Jul 2016 19:53:42 +0000 (15:53 -0400)
Add a tracepoint to track when the processing of incoming RPC data gets
deferred due to out-of-space issues on the outgoing transport.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
include/trace/events/sunrpc.h
net/sunrpc/svc_xprt.c

index 5664ca07c9c7d8b9634250338cfcf72094e827d7..b014207a95a863cacb089dbe28a3f088bdcbbd35 100644 (file)
@@ -553,7 +553,7 @@ TRACE_EVENT(svc_xprt_do_enqueue,
                __entry->pid, show_svc_xprt_flags(__entry->flags))
 );
 
-TRACE_EVENT(svc_xprt_dequeue,
+DECLARE_EVENT_CLASS(svc_xprt_event,
        TP_PROTO(struct svc_xprt *xprt),
 
        TP_ARGS(xprt),
@@ -582,6 +582,14 @@ TRACE_EVENT(svc_xprt_dequeue,
                show_svc_xprt_flags(__entry->flags))
 );
 
+DEFINE_EVENT(svc_xprt_event, svc_xprt_dequeue,
+       TP_PROTO(struct svc_xprt *xprt),
+       TP_ARGS(xprt));
+
+DEFINE_EVENT(svc_xprt_event, svc_xprt_no_write_space,
+       TP_PROTO(struct svc_xprt *xprt),
+       TP_ARGS(xprt));
+
 TRACE_EVENT(svc_wake_up,
        TP_PROTO(int pid),
 
index 4f01f63102ee5d1ce936f54fa8feb3cedfc15607..4d2189a562af00f5eb47ad794bfe4596c73e472e 100644 (file)
@@ -333,8 +333,12 @@ static bool svc_xprt_has_something_to_do(struct svc_xprt *xprt)
 {
        if (xprt->xpt_flags & ((1<<XPT_CONN)|(1<<XPT_CLOSE)))
                return true;
-       if (xprt->xpt_flags & ((1<<XPT_DATA)|(1<<XPT_DEFERRED)))
-               return xprt->xpt_ops->xpo_has_wspace(xprt);
+       if (xprt->xpt_flags & ((1<<XPT_DATA)|(1<<XPT_DEFERRED))) {
+               if (xprt->xpt_ops->xpo_has_wspace(xprt))
+                       return true;
+               trace_svc_xprt_no_write_space(xprt);
+               return false;
+       }
        return false;
 }