All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: bfields@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v1 08/14] SUNRPC: Report short RPC messages via a tracepoint
Date: Sat, 16 Oct 2021 18:47:10 -0400	[thread overview]
Message-ID: <163442443046.1001.10047809524619807215.stgit@bazille.1015granger.net> (raw)
In-Reply-To: <163442364683.1001.4500967510037013459.stgit@bazille.1015granger.net>

Replace a dprintk call site. The new tracepoint can be left enabled
persistently to capture problems.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 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:


  parent reply	other threads:[~2021-10-16 22:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-16 22:46 [PATCH v1 00/14] Some RPC server dprintk clean up Chuck Lever
2021-10-16 22:46 ` [PATCH v1 01/14] SUNRPC: Update the show_svc_xprt_flags() macro Chuck Lever
2021-10-16 22:46 ` [PATCH v1 02/14] SUNRPC: Remove dprintk call sites from svcauth_unix.c Chuck Lever
2021-10-16 22:46 ` [PATCH v1 03/14] SUNRPC: Remove dprintk call site from svc_authenticate() Chuck Lever
2021-10-16 22:46 ` [PATCH v1 04/14] SUNRPC: Clean up svc_destroy() Chuck Lever
2021-10-16 22:46 ` [PATCH v1 05/14] SUNRPC: Remove dprintk call site from __svc_create() Chuck Lever
2021-10-16 22:46 ` [PATCH v1 06/14] SUNRPC: Remove dprintk call site from bc_svc_process() Chuck Lever
2021-10-16 22:47 ` [PATCH v1 07/14] SUNRPC: Remove redundant dprintk call sites from svc_process_common() Chuck Lever
2021-10-16 22:47 ` Chuck Lever [this message]
2021-10-16 22:47 ` [PATCH v1 09/14] SUNRPC: Report RPC messages with unknown programs via a tracepoint Chuck Lever
2021-10-16 22:47 ` [PATCH v1 10/14] SUNRPC: Report RPC messages with unknown versions " Chuck Lever
2021-10-16 22:47 ` [PATCH v1 11/14] SUNRPC: Report RPC messages with unknown procedures " Chuck Lever
2021-10-16 22:47 ` [PATCH v1 12/14] SUNRPC: Report RPC messages that can't be decoded " Chuck Lever
2021-10-16 22:47 ` [PATCH v1 13/14] SUNRPC: Fix kdoc comment for svc_unregister() Chuck Lever
2021-10-16 22:47 ` [PATCH v1 14/14] SUNRPC: Yank some low-value dprintk call sites Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=163442443046.1001.10047809524619807215.stgit@bazille.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.