linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH v1 14/22] SUNRPC: Clean up call_bind_status() observability
Date: Wed, 08 Jul 2020 16:10:14 -0400	[thread overview]
Message-ID: <20200708201014.22129.22280.stgit@manet.1015granger.net> (raw)
In-Reply-To: <20200708200121.22129.92375.stgit@manet.1015granger.net>

Time to remove dprintk call sites in here.

Regarding the rpc_bind_status tracepoint: It's friendlier to
administrators if they don't have to look up the error code to
figure out what went wrong. Replace trace_rpc_bind_status with a
set of tracepoints that report more specifically what the problem
was, and what RPC program/version was being queried.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 include/trace/events/sunrpc.h |   14 +++++++++++++-
 net/sunrpc/clnt.c             |   20 ++++++--------------
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 1fcff409d91b..8bc5f966b22d 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -259,7 +259,6 @@ DECLARE_EVENT_CLASS(rpc_task_status,
 			TP_ARGS(task))
 
 DEFINE_RPC_STATUS_EVENT(call);
-DEFINE_RPC_STATUS_EVENT(bind);
 DEFINE_RPC_STATUS_EVENT(connect);
 DEFINE_RPC_STATUS_EVENT(timeout);
 DEFINE_RPC_STATUS_EVENT(retry_refresh);
@@ -520,6 +519,19 @@ DEFINE_RPC_REPLY_EVENT(stale_creds);
 DEFINE_RPC_REPLY_EVENT(bad_creds);
 DEFINE_RPC_REPLY_EVENT(auth_tooweak);
 
+#define DEFINE_RPCB_ERROR_EVENT(name)					\
+	DEFINE_EVENT(rpc_reply_event, rpcb_##name##_err,		\
+			TP_PROTO(					\
+				const struct rpc_task *task		\
+			),						\
+			TP_ARGS(task))
+
+DEFINE_RPCB_ERROR_EVENT(prog_unavail);
+DEFINE_RPCB_ERROR_EVENT(timeout);
+DEFINE_RPCB_ERROR_EVENT(bind_version);
+DEFINE_RPCB_ERROR_EVENT(unreachable);
+DEFINE_RPCB_ERROR_EVENT(unrecognized);
+
 TRACE_EVENT(rpc_buf_alloc,
 	TP_PROTO(
 		const struct rpc_task *task,
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 90e3d9dae34c..c434ecd54cdd 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1957,7 +1957,6 @@ call_bind_status(struct rpc_task *task)
 		return;
 	}
 
-	trace_rpc_bind_status(task);
 	if (task->tk_status >= 0)
 		goto out_next;
 	if (xprt_bound(xprt)) {
@@ -1967,12 +1966,10 @@ call_bind_status(struct rpc_task *task)
 
 	switch (task->tk_status) {
 	case -ENOMEM:
-		dprintk("RPC: %5u rpcbind out of memory\n", task->tk_pid);
 		rpc_delay(task, HZ >> 2);
 		goto retry_timeout;
 	case -EACCES:
-		dprintk("RPC: %5u remote rpcbind: RPC program/version "
-				"unavailable\n", task->tk_pid);
+		trace_rpcb_prog_unavail_err(task);
 		/* fail immediately if this is an RPC ping */
 		if (task->tk_msg.rpc_proc->p_proc == 0) {
 			status = -EOPNOTSUPP;
@@ -1989,17 +1986,14 @@ call_bind_status(struct rpc_task *task)
 	case -EAGAIN:
 		goto retry_timeout;
 	case -ETIMEDOUT:
-		dprintk("RPC: %5u rpcbind request timed out\n",
-				task->tk_pid);
+		trace_rpcb_timeout_err(task);
 		goto retry_timeout;
 	case -EPFNOSUPPORT:
 		/* server doesn't support any rpcbind version we know of */
-		dprintk("RPC: %5u unrecognized remote rpcbind service\n",
-				task->tk_pid);
+		trace_rpcb_bind_version_err(task);
 		break;
 	case -EPROTONOSUPPORT:
-		dprintk("RPC: %5u remote rpcbind version unavailable, retrying\n",
-				task->tk_pid);
+		trace_rpcb_bind_version_err(task);
 		goto retry_timeout;
 	case -ECONNREFUSED:		/* connection problems */
 	case -ECONNRESET:
@@ -2010,8 +2004,7 @@ call_bind_status(struct rpc_task *task)
 	case -EHOSTUNREACH:
 	case -ENETUNREACH:
 	case -EPIPE:
-		dprintk("RPC: %5u remote rpcbind unreachable: %d\n",
-				task->tk_pid, task->tk_status);
+		trace_rpcb_unreachable_err(task);
 		if (!RPC_IS_SOFTCONN(task)) {
 			rpc_delay(task, 5*HZ);
 			goto retry_timeout;
@@ -2019,8 +2012,7 @@ call_bind_status(struct rpc_task *task)
 		status = task->tk_status;
 		break;
 	default:
-		dprintk("RPC: %5u unrecognized rpcbind error (%d)\n",
-				task->tk_pid, -task->tk_status);
+		trace_rpcb_unrecognized_err(task);
 	}
 
 	rpc_call_rpcerror(task, status);


  parent reply	other threads:[~2020-07-08 20:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 20:08 [PATCH v1 00/22] SUNRPC: Replace dprintk calls with tracepoints Chuck Lever
2020-07-08 20:09 ` [PATCH v1 01/22] SUNRPC: Remove trace_xprt_complete_rqst() Chuck Lever
2020-07-08 20:09 ` [PATCH v1 02/22] SUNRPC: Hoist trace_xprtrdma_op_allocate into generic code Chuck Lever
2020-07-08 20:09 ` [PATCH v1 03/22] SUNRPC: Remove debugging instrumentation from xprt_release Chuck Lever
2020-07-08 20:09 ` [PATCH v1 04/22] SUNRPC: Update debugging instrumentation in xprt_do_reserve() Chuck Lever
2020-07-08 20:09 ` [PATCH v1 05/22] SUNRPC: Replace dprintk() call site in xprt_prepare_transmit Chuck Lever
2020-07-08 20:09 ` [PATCH v1 06/22] SUNRPC: Replace dprintk() call site in xs_nospace() Chuck Lever
2020-07-08 20:09 ` [PATCH v1 07/22] SUNRPC: Remove the dprint_status() macro Chuck Lever
2020-07-08 20:09 ` [PATCH v1 08/22] SUNRPC: Remove dprintk call site in call_start() Chuck Lever
2020-07-08 20:09 ` [PATCH v1 09/22] SUNRPC: Replace connect dprintk call sites with a tracepoint Chuck Lever
2020-07-08 20:09 ` [PATCH v1 10/22] SUNRPC: Mitigate cond_resched() in xprt_transmit() Chuck Lever
2020-07-08 20:09 ` [PATCH v1 11/22] SUNRPC: Add trace_rpc_timeout_status() Chuck Lever
2020-07-08 20:10 ` [PATCH v1 12/22] SUNRPC: Trace call_refresh events Chuck Lever
2020-07-08 20:10 ` [PATCH v1 13/22] SUNRPC: Remove dprintk call site in call_decode Chuck Lever
2020-07-08 20:10 ` Chuck Lever [this message]
2020-07-08 20:10 ` [PATCH v1 15/22] SUNRPC: Remove rpcb_getport_async dprintk call sites Chuck Lever
2020-07-08 20:10 ` [PATCH v1 16/22] SUNRPC: Hoist trace_xprtrdma_op_setport into generic code Chuck Lever
2020-07-08 20:10 ` [PATCH v1 17/22] SUNRPC: Remove dprintk call sites in rpcbind XDR functions Chuck Lever
2020-07-08 20:10 ` [PATCH v1 18/22] SUNRPC: Remove more dprintks in rpcb_clnt.c Chuck Lever
2020-07-08 20:10 ` [PATCH v1 19/22] SUNRPC: Replace rpcbind dprintk call sites with tracepoints Chuck Lever
2020-07-08 20:10 ` [PATCH v1 20/22] SUNRPC: Clean up RPC scheduler tracepoints Chuck Lever
2020-07-08 20:10 ` [PATCH v1 21/22] SUNRPC: Remove dprintk call sites in RPC queuing functions Chuck Lever
2020-07-08 20:10 ` [PATCH v1 22/22] SUNRPC: Remove remaining dprintks from sched.c Chuck Lever
2020-08-17 17:25 ` [PATCH v1 00/22] SUNRPC: Replace dprintk calls with tracepoints 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=20200708201014.22129.22280.stgit@manet.1015granger.net \
    --to=chuck.lever@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).