Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Trond Myklebust and committed by
J. Bruce Fields
82ea2d76 d28c442f

+15 -3
+9 -1
include/trace/events/sunrpc.h
··· 553 553 __entry->pid, show_svc_xprt_flags(__entry->flags)) 554 554 ); 555 555 556 - TRACE_EVENT(svc_xprt_dequeue, 556 + DECLARE_EVENT_CLASS(svc_xprt_event, 557 557 TP_PROTO(struct svc_xprt *xprt), 558 558 559 559 TP_ARGS(xprt), ··· 581 581 (struct sockaddr *)__get_dynamic_array(addr) : NULL, 582 582 show_svc_xprt_flags(__entry->flags)) 583 583 ); 584 + 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)); 584 592 585 593 TRACE_EVENT(svc_wake_up, 586 594 TP_PROTO(int pid),
+6 -2
net/sunrpc/svc_xprt.c
··· 333 333 { 334 334 if (xprt->xpt_flags & ((1<<XPT_CONN)|(1<<XPT_CLOSE))) 335 335 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 + } 338 342 return false; 339 343 } 340 344