In many cases, tracepoints already report these errors. In others, the dprintks were mainly useful when this code was less mature.
Unified · Split
| @@ -1269,6 +1269,41 @@ TRACE_EVENT(xs_stream_read_request, · 1268 unmodified lines | |||
| 1269 | __entry->copied, __entry->reclen, __entry->offset) | 1269 | __entry->copied, __entry->reclen, __entry->offset) |
| 1270 | ); | 1270 | ); |
| 1271 | 1271 | ||
| 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 | ); | ||
| 1272 | 1307 | ||
| 1273 | DECLARE_EVENT_CLASS(svc_xdr_buf_class, | 1308 | DECLARE_EVENT_CLASS(svc_xdr_buf_class, |
| 1274 | TP_PROTO( | 1309 | TP_PROTO( |
| @@ -31,6 +31,8 @@ · 30 unmodified lines | |||
| 31 | #include <linux/sunrpc/sched.h> | 31 | #include <linux/sunrpc/sched.h> |
| 32 | #include <linux/sunrpc/xprtsock.h> | 32 | #include <linux/sunrpc/xprtsock.h> |
| 33 | 33 | ||
| 34 | #include <trace/events/sunrpc.h> | ||
| 35 | |||
| 34 | #include "netns.h" | 36 | #include "netns.h" |
| 35 | 37 | ||
| 36 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) | 38 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
| @@ -693,18 +695,12 @@ void rpcb_getport_async(struct rpc_task *task) · 656 unmodified lines | |||
| 693 | rcu_read_unlock(); | 695 | rcu_read_unlock(); |
| 694 | xprt = xprt_get(task->tk_xprt); | 696 | xprt = xprt_get(task->tk_xprt); |
| 695 | 697 | ||
| 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 | |||
| 700 | /* Put self on the wait queue to ensure we get notified if | 698 | /* Put self on the wait queue to ensure we get notified if |
| 701 | * some other task is already attempting to bind the port */ | 699 | * some other task is already attempting to bind the port */ |
| 702 | rpc_sleep_on_timeout(&xprt->binding, task, | 700 | rpc_sleep_on_timeout(&xprt->binding, task, |
| 703 | NULL, jiffies + xprt->bind_timeout); | 701 | NULL, jiffies + xprt->bind_timeout); |
| 704 | 702 | ||
| 705 | if (xprt_test_and_set_binding(xprt)) { | 703 | if (xprt_test_and_set_binding(xprt)) { |
| 706 | dprintk("RPC: %5u %s: waiting for another binder\n", | ||
| 707 | task->tk_pid, __func__); | ||
| 708 | xprt_put(xprt); | 704 | xprt_put(xprt); |
| 709 | return; | 705 | return; |
| 710 | } | 706 | } |
| @@ -712,8 +708,6 @@ void rpcb_getport_async(struct rpc_task *task) · 1 unmodified line | |||
| 712 | /* Someone else may have bound if we slept */ | 708 | /* Someone else may have bound if we slept */ |
| 713 | if (xprt_bound(xprt)) { | 709 | if (xprt_bound(xprt)) { |
| 714 | status = 0; | 710 | status = 0; |
| 715 | dprintk("RPC: %5u %s: already bound\n", | ||
| 716 | task->tk_pid, __func__); | ||
| 717 | goto bailout_nofree; | 711 | goto bailout_nofree; |
| 718 | } | 712 | } |
| 719 | 713 | ||
| @@ -732,20 +726,15 @@ void rpcb_getport_async(struct rpc_task *task) · 12 unmodified lines | |||
| 732 | break; | 726 | break; |
| 733 | default: | 727 | default: |
| 734 | status = -EAFNOSUPPORT; | 728 | status = -EAFNOSUPPORT; |
| 735 | dprintk("RPC: %5u %s: bad address family\n", | ||
| 736 | task->tk_pid, __func__); | ||
| 737 | goto bailout_nofree; | 729 | goto bailout_nofree; |
| 738 | } | 730 | } |
| 739 | if (proc == NULL) { | 731 | if (proc == NULL) { |
| 740 | xprt->bind_index = 0; | 732 | xprt->bind_index = 0; |
| 741 | status = -EPFNOSUPPORT; | 733 | status = -EPFNOSUPPORT; |
| 742 | dprintk("RPC: %5u %s: no more getport versions available\n", | ||
| 743 | task->tk_pid, __func__); | ||
| 744 | goto bailout_nofree; | 734 | goto bailout_nofree; |
| 745 | } | 735 | } |
| 746 | 736 | ||
| 747 | dprintk("RPC: %5u %s: trying rpcbind version %u\n", | 737 | trace_rpcb_getport(clnt, task, bind_version); |
| 748 | task->tk_pid, __func__, bind_version); | ||
| 749 | 738 | ||
| 750 | rpcb_clnt = rpcb_create(xprt->xprt_net, | 739 | rpcb_clnt = rpcb_create(xprt->xprt_net, |
| 751 | clnt->cl_nodename, | 740 | clnt->cl_nodename, |
| @@ -754,16 +743,12 @@ void rpcb_getport_async(struct rpc_task *task) · 2 unmodified lines | |||
| 754 | clnt->cl_cred); | 743 | clnt->cl_cred); |
| 755 | if (IS_ERR(rpcb_clnt)) { | 744 | if (IS_ERR(rpcb_clnt)) { |
| 756 | status = PTR_ERR(rpcb_clnt); | 745 | 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)); | ||
| 759 | goto bailout_nofree; | 746 | goto bailout_nofree; |
| 760 | } | 747 | } |
| 761 | 748 | ||
| 762 | map = kzalloc(sizeof(struct rpcbind_args), GFP_NOFS); | 749 | map = kzalloc(sizeof(struct rpcbind_args), GFP_NOFS); |
| 763 | if (!map) { | 750 | if (!map) { |
| 764 | status = -ENOMEM; | 751 | status = -ENOMEM; |
| 765 | dprintk("RPC: %5u %s: no memory available\n", | ||
| 766 | task->tk_pid, __func__); | ||
| 767 | goto bailout_release_client; | 752 | goto bailout_release_client; |
| 768 | } | 753 | } |
| 769 | map->r_prog = clnt->cl_prog; | 754 | map->r_prog = clnt->cl_prog; |
| @@ -780,8 +765,6 @@ void rpcb_getport_async(struct rpc_task *task) · 10 unmodified lines | |||
| 780 | map->r_addr = rpc_sockaddr2uaddr(sap, GFP_NOFS); | 765 | map->r_addr = rpc_sockaddr2uaddr(sap, GFP_NOFS); |
| 781 | if (!map->r_addr) { | 766 | if (!map->r_addr) { |
| 782 | status = -ENOMEM; | 767 | status = -ENOMEM; |
| 783 | dprintk("RPC: %5u %s: no memory available\n", | ||
| 784 | task->tk_pid, __func__); | ||
| 785 | goto bailout_free_args; | 768 | goto bailout_free_args; |
| 786 | } | 769 | } |
| 787 | map->r_owner = ""; | 770 | map->r_owner = ""; |