Replace a dprintk call site. The new tracepoint can be left enabled persistently to capture problems. Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx> --- include/trace/events/sunrpc.h | 23 +++++++++++++++++++++++ net/sunrpc/svc.c | 3 +-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index 23b0964e0425..3cfdd0ef6600 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h @@ -1642,6 +1642,29 @@ TRACE_EVENT(svc_process, ) ); +TRACE_EVENT(svc_decode_len_err, + TP_PROTO( + const struct svc_rqst *rqst, + const struct kvec *argv + ), + + TP_ARGS(rqst, argv), + + TP_STRUCT__entry( + __field(size_t, len) + __string(addr, rqst->rq_xprt ? + rqst->rq_xprt->xpt_remotebuf : "(null)") + ), + + TP_fast_assign( + __entry->len = argv->iov_len; + __assign_str(addr, rqst->rq_xprt ? + rqst->rq_xprt->xpt_remotebuf : "(null)"); + ), + + TP_printk("addr=%s len=%zu", __get_str(addr), __entry->len) +); + DECLARE_EVENT_CLASS(svc_rqst_event, TP_PROTO( diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 5cfbda94e759..3d95faffe43b 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -1379,8 +1379,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) return 0; err_short_len: - svc_printk(rqstp, "short len %zd, dropping request\n", - argv->iov_len); + trace_svc_decode_len_err(rqstp, argv); goto close_xprt; err_bad_rpc: