All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Two fixes for RPC static trace points
@ 2017-11-03 17:45 Chuck Lever
  2017-11-03 17:46 ` [PATCH 1/2] sunrpc: Fix rpc_task_begin trace point Chuck Lever
  2017-11-03 17:46 ` [PATCH 2/2] sunrpc: Add rpc_request static " Chuck Lever
  0 siblings, 2 replies; 3+ messages in thread
From: Chuck Lever @ 2017-11-03 17:45 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs

Please consider this series for v4.15. Thanks!

---

Chuck Lever (2):
      sunrpc: Fix rpc_task_begin trace point
      sunrpc: Add rpc_request static trace point


 include/trace/events/sunrpc.h |   30 ++++++++++++++++++++++++++++++
 net/sunrpc/clnt.c             |    3 +--
 net/sunrpc/sched.c            |    3 +--
 3 files changed, 32 insertions(+), 4 deletions(-)

--
Chuck Lever

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] sunrpc: Fix rpc_task_begin trace point
  2017-11-03 17:45 [PATCH 0/2] Two fixes for RPC static trace points Chuck Lever
@ 2017-11-03 17:46 ` Chuck Lever
  2017-11-03 17:46 ` [PATCH 2/2] sunrpc: Add rpc_request static " Chuck Lever
  1 sibling, 0 replies; 3+ messages in thread
From: Chuck Lever @ 2017-11-03 17:46 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs

The rpc_task_begin trace point always display a task ID of zero.
Move the trace point call site so that it picks up the new task ID.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/sched.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 0cc8383..f9db5fe 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -274,10 +274,9 @@ static inline void rpc_task_set_debuginfo(struct rpc_task *task)
 
 static void rpc_set_active(struct rpc_task *task)
 {
-	trace_rpc_task_begin(task->tk_client, task, NULL);
-
 	rpc_task_set_debuginfo(task);
 	set_bit(RPC_TASK_ACTIVE, &task->tk_runstate);
+	trace_rpc_task_begin(task->tk_client, task, NULL);
 }
 
 /*


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] sunrpc: Add rpc_request static trace point
  2017-11-03 17:45 [PATCH 0/2] Two fixes for RPC static trace points Chuck Lever
  2017-11-03 17:46 ` [PATCH 1/2] sunrpc: Fix rpc_task_begin trace point Chuck Lever
@ 2017-11-03 17:46 ` Chuck Lever
  1 sibling, 0 replies; 3+ messages in thread
From: Chuck Lever @ 2017-11-03 17:46 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs

Display information about the RPC procedure being requested in the
trace log. This sometimes critical information cannot always be
derived from other RPC trace entries.

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

diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 82e5057..d7c6dc7 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -70,6 +70,36 @@
 		__entry->status)
 );
 
+TRACE_EVENT(rpc_request,
+	TP_PROTO(const struct rpc_task *task),
+
+	TP_ARGS(task),
+
+	TP_STRUCT__entry(
+		__field(unsigned int, task_id)
+		__field(unsigned int, client_id)
+		__field(int, version)
+		__field(bool, async)
+		__string(progname, task->tk_client->cl_program->name)
+		__string(procname, rpc_proc_name(task))
+	),
+
+	TP_fast_assign(
+		__entry->task_id = task->tk_pid;
+		__entry->client_id = task->tk_client->cl_clid;
+		__entry->version = task->tk_client->cl_vers;
+		__entry->async = RPC_IS_ASYNC(task);
+		__assign_str(progname, task->tk_client->cl_program->name)
+		__assign_str(procname, rpc_proc_name(task))
+	),
+
+	TP_printk("task:%u@%u %sv%d %s (%ssync)",
+		__entry->task_id, __entry->client_id,
+		__get_str(progname), __entry->version,
+		__get_str(procname), __entry->async ? "a": ""
+		)
+);
+
 DECLARE_EVENT_CLASS(rpc_task_running,
 
 	TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 2ad827d..3e4fcdd 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1491,7 +1491,6 @@ void rpc_force_rebind(struct rpc_clnt *clnt)
 }
 EXPORT_SYMBOL_GPL(rpc_restart_call);
 
-#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
 const char
 *rpc_proc_name(const struct rpc_task *task)
 {
@@ -1505,7 +1504,6 @@ void rpc_force_rebind(struct rpc_clnt *clnt)
 	} else
 		return "no proc";
 }
-#endif
 
 /*
  * 0.  Initial state
@@ -1519,6 +1517,7 @@ void rpc_force_rebind(struct rpc_clnt *clnt)
 	struct rpc_clnt	*clnt = task->tk_client;
 	int idx = task->tk_msg.rpc_proc->p_statidx;
 
+	trace_rpc_request(task);
 	dprintk("RPC: %5u call_start %s%d proc %s (%s)\n", task->tk_pid,
 			clnt->cl_program->name, clnt->cl_vers,
 			rpc_proc_name(task),


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-03 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03 17:45 [PATCH 0/2] Two fixes for RPC static trace points Chuck Lever
2017-11-03 17:46 ` [PATCH 1/2] sunrpc: Fix rpc_task_begin trace point Chuck Lever
2017-11-03 17:46 ` [PATCH 2/2] sunrpc: Add rpc_request static " Chuck Lever

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.