diff options
author | Chuck Lever <cel@netapp.com> | 2006-03-20 13:44:22 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:22 -0500 |
commit | cc0175c1dc1de8f6af0eb0631dcc5b999a6fcc42 (patch) | |
tree | b219a9c16f0ef3ff0982450c32aa0f09d503782a /net/sunrpc/stats.c | |
parent | 4ece3a2d18fd7fe1d4972284a8c98c569020093f (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.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 24ac7163b9c7..53746793eca2 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
@@ -151,7 +151,7 @@ void rpc_count_iostats(struct rpc_task *task) | |||
151 | 151 | ||
152 | if (!stats || !req) | 152 | if (!stats || !req) |
153 | return; | 153 | return; |
154 | op_metrics = &stats[task->tk_msg.rpc_proc->p_proc]; | 154 | op_metrics = &stats[task->tk_msg.rpc_proc->p_statidx]; |
155 | 155 | ||
156 | op_metrics->om_ops++; | 156 | op_metrics->om_ops++; |
157 | op_metrics->om_ntrans += req->rq_ntrans; | 157 | op_metrics->om_ntrans += req->rq_ntrans; |
@@ -176,6 +176,16 @@ void rpc_count_iostats(struct rpc_task *task) | |||
176 | op_metrics->om_execute += execute; | 176 | op_metrics->om_execute += execute; |
177 | } | 177 | } |
178 | 178 | ||
179 | void _print_name(struct seq_file *seq, unsigned int op, struct rpc_procinfo *procs) | ||
180 | { | ||
181 | if (procs[op].p_name) | ||
182 | seq_printf(seq, "\t%12s: ", procs[op].p_name); | ||
183 | else if (op == 0) | ||
184 | seq_printf(seq, "\t NULL: "); | ||
185 | else | ||
186 | seq_printf(seq, "\t%12u: ", op); | ||
187 | } | ||
188 | |||
179 | #define MILLISECS_PER_JIFFY (1000UL / HZ) | 189 | #define MILLISECS_PER_JIFFY (1000UL / HZ) |
180 | 190 | ||
181 | void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) | 191 | 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) | |||
197 | seq_printf(seq, "\tper-op statistics\n"); | 207 | seq_printf(seq, "\tper-op statistics\n"); |
198 | for (op = 0; op < maxproc; op++) { | 208 | for (op = 0; op < maxproc; op++) { |
199 | struct rpc_iostats *metrics = &stats[op]; | 209 | struct rpc_iostats *metrics = &stats[op]; |
200 | seq_printf(seq, "%12u: ", op); | 210 | _print_name(seq, op, clnt->cl_procinfo); |
201 | seq_printf(seq, "%lu %lu %lu %Lu %Lu %Lu %Lu %Lu\n", | 211 | seq_printf(seq, "%lu %lu %lu %Lu %Lu %Lu %Lu %Lu\n", |
202 | metrics->om_ops, | 212 | metrics->om_ops, |
203 | metrics->om_ntrans, | 213 | metrics->om_ntrans, |