Skip to content

Commit 82ea2d7

Browse files
trondmypdJ. Bruce Fields
authored andcommitted
SUNRPC: Add a tracepoint for server socket out-of-space conditions
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 <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent d28c442 commit 82ea2d7

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

include/trace/events/sunrpc.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ TRACE_EVENT(svc_xprt_do_enqueue,
553553
__entry->pid, show_svc_xprt_flags(__entry->flags))
554554
);
555555

556-
TRACE_EVENT(svc_xprt_dequeue,
556+
DECLARE_EVENT_CLASS(svc_xprt_event,
557557
TP_PROTO(struct svc_xprt *xprt),
558558

559559
TP_ARGS(xprt),
@@ -582,6 +582,14 @@ TRACE_EVENT(svc_xprt_dequeue,
582582
show_svc_xprt_flags(__entry->flags))
583583
);
584584

585+
DEFINE_EVENT(svc_xprt_event, svc_xprt_dequeue,
586+
TP_PROTO(struct svc_xprt *xprt),
587+
TP_ARGS(xprt));
588+
589+
DEFINE_EVENT(svc_xprt_event, svc_xprt_no_write_space,
590+
TP_PROTO(struct svc_xprt *xprt),
591+
TP_ARGS(xprt));
592+
585593
TRACE_EVENT(svc_wake_up,
586594
TP_PROTO(int pid),
587595

net/sunrpc/svc_xprt.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,12 @@ static bool svc_xprt_has_something_to_do(struct svc_xprt *xprt)
333333
{
334334
if (xprt->xpt_flags & ((1<<XPT_CONN)|(1<<XPT_CLOSE)))
335335
return true;
336-
if (xprt->xpt_flags & ((1<<XPT_DATA)|(1<<XPT_DEFERRED)))
337-
return xprt->xpt_ops->xpo_has_wspace(xprt);
336+
if (xprt->xpt_flags & ((1<<XPT_DATA)|(1<<XPT_DEFERRED))) {
337+
if (xprt->xpt_ops->xpo_has_wspace(xprt))
338+
return true;
339+
trace_svc_xprt_no_write_space(xprt);
340+
return false;
341+
}
338342
return false;
339343
}
340344

0 commit comments

Comments
 (0)