Skip to content

Commit 10db569

Browse files
NeilBrownTrond Myklebust
authored andcommitted
SUNRPC: enhance rpc_clnt_show_stats() to report on all xprts.
Now that a client can have multiple xprts, we need to report the statistics for all of them. Reported-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent 5a0c257 commit 10db569

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎net/sunrpc/stats.c‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,16 @@ static void _print_rpc_iostats(struct seq_file *seq, struct rpc_iostats *stats,
236236
ktime_to_ms(stats->om_execute));
237237
}
238238

239+
static int do_print_stats(struct rpc_clnt *clnt, struct rpc_xprt *xprt, void *seqv)
240+
{
241+
struct seq_file *seq = seqv;
242+
243+
xprt->ops->print_stats(xprt, seq);
244+
return 0;
245+
}
246+
239247
void rpc_clnt_show_stats(struct seq_file *seq, struct rpc_clnt *clnt)
240248
{
241-
struct rpc_xprt *xprt;
242249
unsigned int op, maxproc = clnt->cl_maxproc;
243250

244251
if (!clnt->cl_metrics)
@@ -248,11 +255,7 @@ void rpc_clnt_show_stats(struct seq_file *seq, struct rpc_clnt *clnt)
248255
seq_printf(seq, "p/v: %u/%u (%s)\n",
249256
clnt->cl_prog, clnt->cl_vers, clnt->cl_program->name);
250257

251-
rcu_read_lock();
252-
xprt = rcu_dereference(clnt->cl_xprt);
253-
if (xprt)
254-
xprt->ops->print_stats(xprt, seq);
255-
rcu_read_unlock();
258+
rpc_clnt_iterate_for_each_xprt(clnt, do_print_stats, seq);
256259

257260
seq_printf(seq, "\tper-op statistics\n");
258261
for (op = 0; op < maxproc; op++) {

0 commit comments

Comments
 (0)