History

SUNRPC: Remove rpcb_getport_async dprintk call sites

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

Chuck Lever committed 6 years ago

Commit e465cc31 parent 42ebfc22 files · +38 −20Browse files

Unified · Split

2 files
  1. include/trace/events/sunrpc.h +35 −0
  2. net/sunrpc/rpcb_clnt.c +3 −20
include/trace/events/sunrpc.h+35−0
@@ -1269,6 +1269,41 @@ TRACE_EVENT(xs_stream_read_request, · 1268 unmodified lines
12691269 __entry->copied, __entry->reclen, __entry->offset)
12701270 );
12711271
1272+TRACE_EVENT(rpcb_getport,
1273+ TP_PROTO(
1274+ const struct rpc_clnt *clnt,
1275+ const struct rpc_task *task,
1276+ unsigned int bind_version
1277+ ),
1278+
1279+ TP_ARGS(clnt, task, bind_version),
1280+
1281+ TP_STRUCT__entry(
1282+ __field(unsigned int, task_id)
1283+ __field(unsigned int, client_id)
1284+ __field(unsigned int, program)
1285+ __field(unsigned int, version)
1286+ __field(int, protocol)
1287+ __field(unsigned int, bind_version)
1288+ __string(servername, task->tk_xprt->servername)
1289+ ),
1290+
1291+ TP_fast_assign(
1292+ __entry->task_id = task->tk_pid;
1293+ __entry->client_id = clnt->cl_clid;
1294+ __entry->program = clnt->cl_prog;
1295+ __entry->version = clnt->cl_vers;
1296+ __entry->protocol = task->tk_xprt->prot;
1297+ __entry->bind_version = bind_version;
1298+ __assign_str(servername, task->tk_xprt->servername);
1299+ ),
1300+
1301+ TP_printk("task:%u@%u server=%s program=%u version=%u protocol=%d bind_version=%u",
1302+ __entry->task_id, __entry->client_id, __get_str(servername),
1303+ __entry->program, __entry->version, __entry->protocol,
1304+ __entry->bind_version
1305+ )
1306+);
12721307
12731308 DECLARE_EVENT_CLASS(svc_xdr_buf_class,
12741309 TP_PROTO(
net/sunrpc/rpcb_clnt.c+3−20
@@ -31,6 +31,8 @@ · 30 unmodified lines
3131 #include <linux/sunrpc/sched.h>
3232 #include <linux/sunrpc/xprtsock.h>
3333
34+#include <trace/events/sunrpc.h>
35+
3436 #include "netns.h"
3537
3638 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
@@ -693,18 +695,12 @@ void rpcb_getport_async(struct rpc_task *task) · 656 unmodified lines
693695 rcu_read_unlock();
694696 xprt = xprt_get(task->tk_xprt);
695697
696− dprintk("RPC: %5u %s(%s, %u, %u, %d)\n",
697− task->tk_pid, __func__,
698− xprt->servername, clnt->cl_prog, clnt->cl_vers, xprt->prot);
699−
700698 /* Put self on the wait queue to ensure we get notified if
701699 * some other task is already attempting to bind the port */
702700 rpc_sleep_on_timeout(&xprt->binding, task,
703701 NULL, jiffies + xprt->bind_timeout);
704702
705703 if (xprt_test_and_set_binding(xprt)) {
706− dprintk("RPC: %5u %s: waiting for another binder\n",
707− task->tk_pid, __func__);
708704 xprt_put(xprt);
709705 return;
710706 }
@@ -712,8 +708,6 @@ void rpcb_getport_async(struct rpc_task *task) · 1 unmodified line
712708 /* Someone else may have bound if we slept */
713709 if (xprt_bound(xprt)) {
714710 status = 0;
715− dprintk("RPC: %5u %s: already bound\n",
716− task->tk_pid, __func__);
717711 goto bailout_nofree;
718712 }
719713
@@ -732,20 +726,15 @@ void rpcb_getport_async(struct rpc_task *task) · 12 unmodified lines
732726 break;
733727 default:
734728 status = -EAFNOSUPPORT;
735− dprintk("RPC: %5u %s: bad address family\n",
736− task->tk_pid, __func__);
737729 goto bailout_nofree;
738730 }
739731 if (proc == NULL) {
740732 xprt->bind_index = 0;
741733 status = -EPFNOSUPPORT;
742− dprintk("RPC: %5u %s: no more getport versions available\n",
743− task->tk_pid, __func__);
744734 goto bailout_nofree;
745735 }
746736
747− dprintk("RPC: %5u %s: trying rpcbind version %u\n",
748− task->tk_pid, __func__, bind_version);
737+ trace_rpcb_getport(clnt, task, bind_version);
749738
750739 rpcb_clnt = rpcb_create(xprt->xprt_net,
751740 clnt->cl_nodename,
@@ -754,16 +743,12 @@ void rpcb_getport_async(struct rpc_task *task) · 2 unmodified lines
754743 clnt->cl_cred);
755744 if (IS_ERR(rpcb_clnt)) {
756745 status = PTR_ERR(rpcb_clnt);
757− dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",
758− task->tk_pid, __func__, PTR_ERR(rpcb_clnt));
759746 goto bailout_nofree;
760747 }
761748
762749 map = kzalloc(sizeof(struct rpcbind_args), GFP_NOFS);
763750 if (!map) {
764751 status = -ENOMEM;
765− dprintk("RPC: %5u %s: no memory available\n",
766− task->tk_pid, __func__);
767752 goto bailout_release_client;
768753 }
769754 map->r_prog = clnt->cl_prog;
@@ -780,8 +765,6 @@ void rpcb_getport_async(struct rpc_task *task) · 10 unmodified lines
780765 map->r_addr = rpc_sockaddr2uaddr(sap, GFP_NOFS);
781766 if (!map->r_addr) {
782767 status = -ENOMEM;
783− dprintk("RPC: %5u %s: no memory available\n",
784− task->tk_pid, __func__);
785768 goto bailout_free_args;
786769 }
787770 map->r_owner = "";

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t