Skip to content

Commit bb50432

Browse files
daimngoAnna Schumaker
authored andcommitted
SUNRPC: display total RPC tasks for RPC client
Display the total number of RPC tasks, including tasks waiting on workqueue and wait queues, for rpc_clnt. Signed-off-by: Dai Ngo <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent e0537c9 commit bb50432

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

net/sunrpc/clnt.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3327,8 +3327,11 @@ bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt,
33273327
EXPORT_SYMBOL_GPL(rpc_clnt_xprt_switch_has_addr);
33283328

33293329
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
3330-
static void rpc_show_header(void)
3330+
static void rpc_show_header(struct rpc_clnt *clnt)
33313331
{
3332+
printk(KERN_INFO "clnt[%pISpc] RPC tasks[%d]\n",
3333+
(struct sockaddr *)&clnt->cl_xprt->addr,
3334+
atomic_read(&clnt->cl_task_count));
33323335
printk(KERN_INFO "-pid- flgs status -client- --rqstp- "
33333336
"-timeout ---ops--\n");
33343337
}
@@ -3360,7 +3363,7 @@ void rpc_show_tasks(struct net *net)
33603363
spin_lock(&clnt->cl_lock);
33613364
list_for_each_entry(task, &clnt->cl_tasks, tk_task) {
33623365
if (!header) {
3363-
rpc_show_header();
3366+
rpc_show_header(clnt);
33643367
header++;
33653368
}
33663369
rpc_show_task(clnt, task);

net/sunrpc/debugfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ tasks_stop(struct seq_file *f, void *v)
7474
{
7575
struct rpc_clnt *clnt = f->private;
7676
spin_unlock(&clnt->cl_lock);
77+
seq_printf(f, "clnt[%pISpc] RPC tasks[%d]\n",
78+
(struct sockaddr *)&clnt->cl_xprt->addr,
79+
atomic_read(&clnt->cl_task_count));
7780
}
7881

7982
static const struct seq_operations tasks_seq_operations = {

0 commit comments

Comments
 (0)