Commit 10db5691 authored by NeilBrown's avatar NeilBrown Committed by Trond Myklebust

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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 5a0c257f
...@@ -236,9 +236,16 @@ static void _print_rpc_iostats(struct seq_file *seq, struct rpc_iostats *stats, ...@@ -236,9 +236,16 @@ static void _print_rpc_iostats(struct seq_file *seq, struct rpc_iostats *stats,
ktime_to_ms(stats->om_execute)); ktime_to_ms(stats->om_execute));
} }
static int do_print_stats(struct rpc_clnt *clnt, struct rpc_xprt *xprt, void *seqv)
{
struct seq_file *seq = seqv;
xprt->ops->print_stats(xprt, seq);
return 0;
}
void rpc_clnt_show_stats(struct seq_file *seq, struct rpc_clnt *clnt) void rpc_clnt_show_stats(struct seq_file *seq, struct rpc_clnt *clnt)
{ {
struct rpc_xprt *xprt;
unsigned int op, maxproc = clnt->cl_maxproc; unsigned int op, maxproc = clnt->cl_maxproc;
if (!clnt->cl_metrics) if (!clnt->cl_metrics)
...@@ -248,11 +255,7 @@ void rpc_clnt_show_stats(struct seq_file *seq, struct rpc_clnt *clnt) ...@@ -248,11 +255,7 @@ void rpc_clnt_show_stats(struct seq_file *seq, struct rpc_clnt *clnt)
seq_printf(seq, "p/v: %u/%u (%s)\n", seq_printf(seq, "p/v: %u/%u (%s)\n",
clnt->cl_prog, clnt->cl_vers, clnt->cl_program->name); clnt->cl_prog, clnt->cl_vers, clnt->cl_program->name);
rcu_read_lock(); rpc_clnt_iterate_for_each_xprt(clnt, do_print_stats, seq);
xprt = rcu_dereference(clnt->cl_xprt);
if (xprt)
xprt->ops->print_stats(xprt, seq);
rcu_read_unlock();
seq_printf(seq, "\tper-op statistics\n"); seq_printf(seq, "\tper-op statistics\n");
for (op = 0; op < maxproc; op++) { for (op = 0; op < maxproc; op++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment