public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: anna.schumaker@netapp.com, trondmy@hammerspace.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v1 06/15] SUNRPC: Add tracepoint to rpc_call_rpcerror()
Date: Tue, 12 May 2020 17:13:23 -0400	[thread overview]
Message-ID: <20200512211323.3288.1681.stgit@manet.1015granger.net> (raw)
In-Reply-To: <20200512210724.3288.15187.stgit@manet.1015granger.net>

Add a tracepoint in another common exit point for failing RPCs.

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

diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index f6896bcfd97f..f1fd3fae5b0f 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -365,6 +365,34 @@
 DEFINE_RPC_REPLY_EVENT(bad_creds);
 DEFINE_RPC_REPLY_EVENT(auth_tooweak);
 
+TRACE_EVENT(rpc_call_rpcerror,
+	TP_PROTO(
+		const struct rpc_task *task,
+		int tk_status,
+		int rpc_status
+	),
+
+	TP_ARGS(task, tk_status, rpc_status),
+
+	TP_STRUCT__entry(
+		__field(unsigned int, task_id)
+		__field(unsigned int, client_id)
+		__field(int, tk_status)
+		__field(int, rpc_status)
+	),
+
+	TP_fast_assign(
+		__entry->client_id = task->tk_client->cl_clid;
+		__entry->task_id = task->tk_pid;
+		__entry->tk_status = tk_status;
+		__entry->rpc_status = rpc_status;
+	),
+
+	TP_printk("task:%u@%u tk_status=%d rpc_status=%d",
+		__entry->task_id, __entry->client_id,
+		__entry->tk_status, __entry->rpc_status)
+);
+
 TRACE_EVENT(rpc_stats_latency,
 
 	TP_PROTO(
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 456e64ca14bc..9151ade01a55 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1624,6 +1624,7 @@ void rpc_force_rebind(struct rpc_clnt *clnt)
 static void
 __rpc_call_rpcerror(struct rpc_task *task, int tk_status, int rpc_status)
 {
+	trace_rpc_call_rpcerror(task, tk_status, rpc_status);
 	task->tk_rpc_status = rpc_status;
 	rpc_exit(task, tk_status);
 }


  parent reply	other threads:[~2020-05-12 21:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 21:12 [PATCH v1 00/15] Possible patches for v5.8 Chuck Lever
2020-05-12 21:12 ` [PATCH v1 01/15] SUNRPC: Signalled ASYNC tasks need to exit Chuck Lever
2020-05-12 21:13 ` [PATCH v1 02/15] SUNRPC: receive buffer size estimation values almost never change Chuck Lever
2020-05-12 21:13 ` [PATCH v1 03/15] SUNRPC: Trace GSS context lifetimes Chuck Lever
2020-05-12 21:13 ` [PATCH v1 04/15] SUNRPC: Update the rpc_show_task_flags() macro Chuck Lever
2020-05-12 21:13 ` [PATCH v1 05/15] SUNRPC: Update the RPC_SHOW_SOCKET() macro Chuck Lever
2020-05-12 21:13 ` Chuck Lever [this message]
2020-05-12 21:13 ` [PATCH v1 07/15] SUNRPC: Split the xdr_buf event class Chuck Lever
2020-05-12 21:13 ` [PATCH v1 08/15] SUNRPC: Trace transport lifetime events Chuck Lever
2020-05-12 21:13 ` [PATCH v1 09/15] SUNRPC: trace RPC client " Chuck Lever
2020-05-12 21:13 ` [PATCH v1 10/15] SUNRPC: rpc_call_null_helper() already sets RPC_TASK_NULLCREDS Chuck Lever
2020-05-12 21:13 ` [PATCH v1 11/15] SUNRPC: rpc_call_null_helper() should set RPC_TASK_SOFT Chuck Lever
2020-05-12 21:13 ` [PATCH v1 12/15] SUNRPC: Set SOFTCONN when destroying GSS contexts Chuck Lever
2020-05-12 21:14 ` [PATCH v1 13/15] NFS: nfs_xdr_status should record the procedure name Chuck Lever
2020-05-12 21:14 ` [PATCH v1 14/15] NFS: Trace short NFS READs Chuck Lever
2020-05-12 21:14 ` [PATCH v1 15/15] NFS: Add a tracepoint in nfs_set_pgio_error() 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=20200512211323.3288.1681.stgit@manet.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@hammerspace.com \
    /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