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 11/14] SUNRPC: Report RPC messages with unknown procedures via a tracepoint
Date: Sat, 16 Oct 2021 18:47:30 -0400	[thread overview]
Message-ID: <163442445010.1001.10719088094457400066.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 |   30 ++++++++++++++++++++++++++++++
 net/sunrpc/svc.c              |    3 +--
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 804912b26abb..85459c40eb35 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -1716,6 +1716,36 @@ TRACE_EVENT(svc_decode_prog_mismatch_err,
 	)
 );
 
+TRACE_EVENT(svc_decode_proc_unavail_err,
+	TP_PROTO(
+		const struct svc_rqst *rqst,
+		const struct svc_program *progp
+	),
+
+	TP_ARGS(rqst, progp),
+
+	TP_STRUCT__entry(
+		__field(u32, procedure)
+		__field(u32, version)
+		__string(progname, progp->pg_name)
+		__string(addr, rqst->rq_xprt ?
+			 rqst->rq_xprt->xpt_remotebuf : "(null)")
+	),
+
+	TP_fast_assign(
+		__entry->version = rqst->rq_vers;
+		__entry->procedure = rqst->rq_proc;
+		__assign_str(progname, progp->pg_name)
+		__assign_str(addr, rqst->rq_xprt ?
+			     rqst->rq_xprt->xpt_remotebuf : "(null)");
+	),
+
+	TP_printk("addr=%s %sv%u procedure=%u",
+		__get_str(addr), __get_str(progname),
+		__entry->version, __entry->procedure
+	)
+);
+
 DECLARE_EVENT_CLASS(svc_rqst_event,
 
 	TP_PROTO(
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 66e46d7755e9..a0f37e89393f 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1414,8 +1414,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
 	goto sendit;
 
 err_bad_proc:
-	svc_printk(rqstp, "unknown procedure (%d)\n", rqstp->rq_proc);
-
+	trace_svc_decode_proc_unavail_err(rqstp, progp);
 	serv->sv_stats->rpcbadfmt++;
 	svc_putnl(resv, RPC_PROC_UNAVAIL);
 	goto sendit;


  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 ` [PATCH v1 08/14] SUNRPC: Report short RPC messages via a tracepoint Chuck Lever
2021-10-16 22:47 ` [PATCH v1 09/14] SUNRPC: Report RPC messages with unknown programs " 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 ` Chuck Lever [this message]
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=163442445010.1001.10719088094457400066.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.