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.
Unified · Split
| @@ -259,7 +259,6 @@ DECLARE_EVENT_CLASS(rpc_task_status, · 258 unmodified lines | ||
| 259 | 259 | TP_ARGS(task)) |
| 260 | 260 | |
| 261 | 261 | DEFINE_RPC_STATUS_EVENT(call); |
| 262 | −DEFINE_RPC_STATUS_EVENT(bind); | |
| 263 | 262 | DEFINE_RPC_STATUS_EVENT(connect); |
| 264 | 263 | DEFINE_RPC_STATUS_EVENT(timeout); |
| 265 | 264 | DEFINE_RPC_STATUS_EVENT(retry_refresh); |
| @@ -520,6 +519,19 @@ DEFINE_RPC_REPLY_EVENT(stale_creds); · 254 unmodified lines | ||
| 520 | 519 | DEFINE_RPC_REPLY_EVENT(bad_creds); |
| 521 | 520 | DEFINE_RPC_REPLY_EVENT(auth_tooweak); |
| 522 | 521 | |
| 522 | +#define DEFINE_RPCB_ERROR_EVENT(name) \ | |
| 523 | + DEFINE_EVENT(rpc_reply_event, rpcb_##name##_err, \ | |
| 524 | + TP_PROTO( \ | |
| 525 | + const struct rpc_task *task \ | |
| 526 | + ), \ | |
| 527 | + TP_ARGS(task)) | |
| 528 | + | |
| 529 | +DEFINE_RPCB_ERROR_EVENT(prog_unavail); | |
| 530 | +DEFINE_RPCB_ERROR_EVENT(timeout); | |
| 531 | +DEFINE_RPCB_ERROR_EVENT(bind_version); | |
| 532 | +DEFINE_RPCB_ERROR_EVENT(unreachable); | |
| 533 | +DEFINE_RPCB_ERROR_EVENT(unrecognized); | |
| 534 | + | |
| 523 | 535 | TRACE_EVENT(rpc_buf_alloc, |
| 524 | 536 | TP_PROTO( |
| 525 | 537 | const struct rpc_task *task, |
| @@ -1957,7 +1957,6 @@ call_bind_status(struct rpc_task *task) · 1956 unmodified lines | ||
| 1957 | 1957 | return; |
| 1958 | 1958 | } |
| 1959 | 1959 | |
| 1960 | − trace_rpc_bind_status(task); | |
| 1961 | 1960 | if (task->tk_status >= 0) |
| 1962 | 1961 | goto out_next; |
| 1963 | 1962 | if (xprt_bound(xprt)) { |
| @@ -1967,12 +1966,10 @@ call_bind_status(struct rpc_task *task) · 3 unmodified lines | ||
| 1967 | 1966 | |
| 1968 | 1967 | switch (task->tk_status) { |
| 1969 | 1968 | case -ENOMEM: |
| 1970 | − dprintk("RPC: %5u rpcbind out of memory\n", task->tk_pid); | |
| 1971 | 1969 | rpc_delay(task, HZ >> 2); |
| 1972 | 1970 | goto retry_timeout; |
| 1973 | 1971 | case -EACCES: |
| 1974 | − dprintk("RPC: %5u remote rpcbind: RPC program/version " | |
| 1975 | − "unavailable\n", task->tk_pid); | |
| 1972 | + trace_rpcb_prog_unavail_err(task); | |
| 1976 | 1973 | /* fail immediately if this is an RPC ping */ |
| 1977 | 1974 | if (task->tk_msg.rpc_proc->p_proc == 0) { |
| 1978 | 1975 | status = -EOPNOTSUPP; |
| @@ -1989,17 +1986,14 @@ call_bind_status(struct rpc_task *task) · 10 unmodified lines | ||
| 1989 | 1986 | case -EAGAIN: |
| 1990 | 1987 | goto retry_timeout; |
| 1991 | 1988 | case -ETIMEDOUT: |
| 1992 | − dprintk("RPC: %5u rpcbind request timed out\n", | |
| 1993 | − task->tk_pid); | |
| 1989 | + trace_rpcb_timeout_err(task); | |
| 1994 | 1990 | goto retry_timeout; |
| 1995 | 1991 | case -EPFNOSUPPORT: |
| 1996 | 1992 | /* server doesn't support any rpcbind version we know of */ |
| 1997 | − dprintk("RPC: %5u unrecognized remote rpcbind service\n", | |
| 1998 | − task->tk_pid); | |
| 1993 | + trace_rpcb_bind_version_err(task); | |
| 1999 | 1994 | break; |
| 2000 | 1995 | case -EPROTONOSUPPORT: |
| 2001 | − dprintk("RPC: %5u remote rpcbind version unavailable, retrying\n", | |
| 2002 | − task->tk_pid); | |
| 1996 | + trace_rpcb_bind_version_err(task); | |
| 2003 | 1997 | goto retry_timeout; |
| 2004 | 1998 | case -ECONNREFUSED: /* connection problems */ |
| 2005 | 1999 | case -ECONNRESET: |
| @@ -2010,8 +2004,7 @@ call_bind_status(struct rpc_task *task) · 4 unmodified lines | ||
| 2010 | 2004 | case -EHOSTUNREACH: |
| 2011 | 2005 | case -ENETUNREACH: |
| 2012 | 2006 | case -EPIPE: |
| 2013 | − dprintk("RPC: %5u remote rpcbind unreachable: %d\n", | |
| 2014 | − task->tk_pid, task->tk_status); | |
| 2007 | + trace_rpcb_unreachable_err(task); | |
| 2015 | 2008 | if (!RPC_IS_SOFTCONN(task)) { |
| 2016 | 2009 | rpc_delay(task, 5*HZ); |
| 2017 | 2010 | goto retry_timeout; |
| @@ -2019,8 +2012,7 @@ call_bind_status(struct rpc_task *task) · 1 unmodified line | ||
| 2019 | 2012 | status = task->tk_status; |
| 2020 | 2013 | break; |
| 2021 | 2014 | default: |
| 2022 | − dprintk("RPC: %5u unrecognized rpcbind error (%d)\n", | |
| 2023 | − task->tk_pid, -task->tk_status); | |
| 2015 | + trace_rpcb_unrecognized_err(task); | |
| 2024 | 2016 | } |
| 2025 | 2017 | |
| 2026 | 2018 | rpc_call_rpcerror(task, status); |