aboutsummaryrefslogtreecommitdiff
path: root/net/sunrpc/stats.c
diff options
context:
space:
mode:
authorChuck Lever <cel@netapp.com>2006-03-20 13:44:22 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:22 -0500
commitcc0175c1dc1de8f6af0eb0631dcc5b999a6fcc42 (patch)
treeb219a9c16f0ef3ff0982450c32aa0f09d503782a /net/sunrpc/stats.c
parent4ece3a2d18fd7fe1d4972284a8c98c569020093f (diff)
SUNRPC: display human-readable procedure name in rpc_iostats output
Add fields to the rpc_procinfo struct that allow the display of a human-readable name for each procedure in the rpc_iostats output. Also fix it so that the NFSv4 stats are broken up correctly by sub-procedure number. NFSv4 uses only two real RPC procedures: NULL, and COMPOUND. Test plan: Mount with NFSv2, NFSv3, and NFSv4, and do "cat /proc/self/mountstats". Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/stats.c')
-rw-r--r--net/sunrpc/stats.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index 24ac7163b9c..53746793eca 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -151,7 +151,7 @@ void rpc_count_iostats(struct rpc_task *task)
if (!stats || !req)
return;
- op_metrics = &stats[task->tk_msg.rpc_proc->p_proc];
+ op_metrics = &stats[task->tk_msg.rpc_proc->p_statidx];
op_metrics->om_ops++;
op_metrics->om_ntrans += req->rq_ntrans;
@@ -176,6 +176,16 @@ void rpc_count_iostats(struct rpc_task *task)
op_metrics->om_execute += execute;
}
+void _print_name(struct seq_file *seq, unsigned int op, struct rpc_procinfo *procs)
+{
+ if (procs[op].p_name)
+ seq_printf(seq, "\t%12s: ", procs[op].p_name);
+ else if (op == 0)
+ seq_printf(seq, "\t NULL: ");
+ else
+ seq_printf(seq, "\t%12u: ", op);
+}
+
#define MILLISECS_PER_JIFFY (1000UL / HZ)
void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt)
@@ -197,7 +207,7 @@ void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt)
seq_printf(seq, "\tper-op statistics\n");
for (op = 0; op < maxproc; op++) {
struct rpc_iostats *metrics = &stats[op];
- seq_printf(seq, "%12u: ", op);
+ _print_name(seq, op, clnt->cl_procinfo);
seq_printf(seq, "%lu %lu %lu %Lu %Lu %Lu %Lu %Lu\n",
metrics->om_ops,
metrics->om_ntrans,