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 15/22] SUNRPC: Remove rpcb_getport_async dprintk call sites
Date: Wed, 08 Jul 2020 16:10:19 -0400	[thread overview]
Message-ID: <20200708201019.22129.13610.stgit@manet.1015granger.net> (raw)
In-Reply-To: <20200708200121.22129.92375.stgit@manet.1015granger.net>

In many cases, tracepoints already report these errors. In others,
the dprintks were mainly useful when this code was less mature.

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

diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 8bc5f966b22d..e6df6740a242 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -1269,6 +1269,41 @@ TRACE_EVENT(xs_stream_read_request,
 			__entry->copied, __entry->reclen, __entry->offset)
 );
 
+TRACE_EVENT(rpcb_getport,
+	TP_PROTO(
+		const struct rpc_clnt *clnt,
+		const struct rpc_task *task,
+		unsigned int bind_version
+	),
+
+	TP_ARGS(clnt, task, bind_version),
+
+	TP_STRUCT__entry(
+		__field(unsigned int, task_id)
+		__field(unsigned int, client_id)
+		__field(unsigned int, program)
+		__field(unsigned int, version)
+		__field(int, protocol)
+		__field(unsigned int, bind_version)
+		__string(servername, task->tk_xprt->servername)
+	),
+
+	TP_fast_assign(
+		__entry->task_id = task->tk_pid;
+		__entry->client_id = clnt->cl_clid;
+		__entry->program = clnt->cl_prog;
+		__entry->version = clnt->cl_vers;
+		__entry->protocol = task->tk_xprt->prot;
+		__entry->bind_version = bind_version;
+		__assign_str(servername, task->tk_xprt->servername);
+	),
+
+	TP_printk("task:%u@%u server=%s program=%u version=%u protocol=%d bind_version=%u",
+		__entry->task_id, __entry->client_id, __get_str(servername),
+		__entry->program, __entry->version, __entry->protocol,
+		__entry->bind_version
+	)
+);
 
 DECLARE_EVENT_CLASS(svc_xdr_buf_class,
 	TP_PROTO(
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index c27123e6ba80..d5c00c0da4f8 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -31,6 +31,8 @@
 #include <linux/sunrpc/sched.h>
 #include <linux/sunrpc/xprtsock.h>
 
+#include <trace/events/sunrpc.h>
+
 #include "netns.h"
 
 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
@@ -693,18 +695,12 @@ void rpcb_getport_async(struct rpc_task *task)
 	rcu_read_unlock();
 	xprt = xprt_get(task->tk_xprt);
 
-	dprintk("RPC: %5u %s(%s, %u, %u, %d)\n",
-		task->tk_pid, __func__,
-		xprt->servername, clnt->cl_prog, clnt->cl_vers, xprt->prot);
-
 	/* Put self on the wait queue to ensure we get notified if
 	 * some other task is already attempting to bind the port */
 	rpc_sleep_on_timeout(&xprt->binding, task,
 			NULL, jiffies + xprt->bind_timeout);
 
 	if (xprt_test_and_set_binding(xprt)) {
-		dprintk("RPC: %5u %s: waiting for another binder\n",
-			task->tk_pid, __func__);
 		xprt_put(xprt);
 		return;
 	}
@@ -712,8 +708,6 @@ void rpcb_getport_async(struct rpc_task *task)
 	/* Someone else may have bound if we slept */
 	if (xprt_bound(xprt)) {
 		status = 0;
-		dprintk("RPC: %5u %s: already bound\n",
-			task->tk_pid, __func__);
 		goto bailout_nofree;
 	}
 
@@ -732,20 +726,15 @@ void rpcb_getport_async(struct rpc_task *task)
 		break;
 	default:
 		status = -EAFNOSUPPORT;
-		dprintk("RPC: %5u %s: bad address family\n",
-				task->tk_pid, __func__);
 		goto bailout_nofree;
 	}
 	if (proc == NULL) {
 		xprt->bind_index = 0;
 		status = -EPFNOSUPPORT;
-		dprintk("RPC: %5u %s: no more getport versions available\n",
-			task->tk_pid, __func__);
 		goto bailout_nofree;
 	}
 
-	dprintk("RPC: %5u %s: trying rpcbind version %u\n",
-		task->tk_pid, __func__, bind_version);
+	trace_rpcb_getport(clnt, task, bind_version);
 
 	rpcb_clnt = rpcb_create(xprt->xprt_net,
 				clnt->cl_nodename,
@@ -754,16 +743,12 @@ void rpcb_getport_async(struct rpc_task *task)
 				clnt->cl_cred);
 	if (IS_ERR(rpcb_clnt)) {
 		status = PTR_ERR(rpcb_clnt);
-		dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",
-			task->tk_pid, __func__, PTR_ERR(rpcb_clnt));
 		goto bailout_nofree;
 	}
 
 	map = kzalloc(sizeof(struct rpcbind_args), GFP_NOFS);
 	if (!map) {
 		status = -ENOMEM;
-		dprintk("RPC: %5u %s: no memory available\n",
-			task->tk_pid, __func__);
 		goto bailout_release_client;
 	}
 	map->r_prog = clnt->cl_prog;
@@ -780,8 +765,6 @@ void rpcb_getport_async(struct rpc_task *task)
 		map->r_addr = rpc_sockaddr2uaddr(sap, GFP_NOFS);
 		if (!map->r_addr) {
 			status = -ENOMEM;
-			dprintk("RPC: %5u %s: no memory available\n",
-				task->tk_pid, __func__);
 			goto bailout_free_args;
 		}
 		map->r_owner = "";


  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 ` [PATCH v1 14/22] SUNRPC: Clean up call_bind_status() observability Chuck Lever
2020-07-08 20:10 ` Chuck Lever [this message]
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=20200708201019.22129.13610.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).