Skip to content

Commit a264aba

Browse files
chuckleverTrond Myklebust
authored andcommitted
SUNRPC: Capture completion of all RPC tasks
RPC tasks on the backchannel never invoke xprt_complete_rqst(), so there is no way to report their tk_status at completion. Also, any RPC task that exits via rpc_exit_task() before it is replied to will also disappear without a trace. Introduce a trace point that is symmetrical with rpc_task_begin that captures the termination status of each RPC task. Sample trace output for callback requests initiated on the server: kworker/u8:12-448 [003] 127.025240: rpc_task_end: task:50@3 flags=ASYNC|DYNAMIC|SOFT|SOFTCONN|SENT runstate=RUNNING|ACTIVE status=0 action=rpc_exit_task kworker/u8:12-448 [002] 127.567310: rpc_task_end: task:51@3 flags=ASYNC|DYNAMIC|SOFT|SOFTCONN|SENT runstate=RUNNING|ACTIVE status=0 action=rpc_exit_task kworker/u8:12-448 [001] 130.506817: rpc_task_end: task:52@3 flags=ASYNC|DYNAMIC|SOFT|SOFTCONN|SENT runstate=RUNNING|ACTIVE status=0 action=rpc_exit_task Odd, though, that I never see trace_rpc_task_complete, either in the forward or backchannel. Should it be removed? Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent e8d70b3 commit a264aba

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

include/trace/events/sunrpc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ DECLARE_EVENT_CLASS(rpc_task_running,
165165
DEFINE_RPC_RUNNING_EVENT(begin);
166166
DEFINE_RPC_RUNNING_EVENT(run_action);
167167
DEFINE_RPC_RUNNING_EVENT(complete);
168+
DEFINE_RPC_RUNNING_EVENT(end);
168169

169170
DECLARE_EVENT_CLASS(rpc_task_queued,
170171

net/sunrpc/sched.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@ rpc_reset_task_statistics(struct rpc_task *task)
824824
*/
825825
void rpc_exit_task(struct rpc_task *task)
826826
{
827+
trace_rpc_task_end(task, task->tk_action);
827828
task->tk_action = NULL;
828829
if (task->tk_ops->rpc_count_stats)
829830
task->tk_ops->rpc_count_stats(task, task->tk_calldata);

0 commit comments

Comments
 (0)