aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/stats.c
diff options
context:
space:
mode:
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 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
179void _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
181void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) 191void 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,