summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDave Wysochanski <dwysocha@redhat.com>2018-07-10 14:59:23 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2018-07-30 13:19:41 -0400
commitacdce5fb8ab47d0baf494d0fed4e9a222741eb38 (patch)
tree99b05b01aa892a8926468b369ddd03926019a5d2 /net
parent82b98ca566ca2af170eb0ab50cef09dd7335fa55 (diff)
downloadlinux-acdce5fb8ab47d0baf494d0fed4e9a222741eb38.tar.bz2
sunrpc: add _print_rpc_iostats() to output metrics for one RPC op
Refactor the output of the metrics for one RPC op into an internal function. No functional change. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/stats.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index f68aa46c9dd7..6606d7b3113a 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -208,6 +208,21 @@ static void _print_name(struct seq_file *seq, unsigned int op,
seq_printf(seq, "\t%12u: ", op);
}
+static void _print_rpc_iostats(struct seq_file *seq, struct rpc_iostats *stats,
+ int op, const struct rpc_procinfo *procs)
+{
+ _print_name(seq, op, procs);
+ seq_printf(seq, "%lu %lu %lu %Lu %Lu %Lu %Lu %Lu\n",
+ stats->om_ops,
+ stats->om_ntrans,
+ stats->om_timeouts,
+ stats->om_bytes_sent,
+ stats->om_bytes_recv,
+ ktime_to_ms(stats->om_queue),
+ ktime_to_ms(stats->om_rtt),
+ ktime_to_ms(stats->om_execute));
+}
+
void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt)
{
struct rpc_iostats *stats = clnt->cl_metrics;
@@ -229,17 +244,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];
- _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,
- metrics->om_timeouts,
- metrics->om_bytes_sent,
- metrics->om_bytes_recv,
- ktime_to_ms(metrics->om_queue),
- ktime_to_ms(metrics->om_rtt),
- ktime_to_ms(metrics->om_execute));
+ _print_rpc_iostats(seq, &stats[op], op, clnt->cl_procinfo);
}
}
EXPORT_SYMBOL_GPL(rpc_print_iostats);