summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorDave Wysochanski <dwysocha@redhat.com>2018-07-10 14:59:24 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2018-07-30 13:19:41 -0400
commit189e1955677d6a704fed3dfbc33893836a48a700 (patch)
tree35e3eea8ffa8706f9ce3c061738f8a2bde8dd1bf /net/sunrpc
parentacdce5fb8ab47d0baf494d0fed4e9a222741eb38 (diff)
downloadlinux-189e1955677d6a704fed3dfbc33893836a48a700.tar.bz2
sunrpc: Add _add_rpc_iostats() to add rpc_iostats metrics
Add a helper function to add the metrics in two rpc_iostats structures. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/stats.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index 6606d7b3113a..32adddd7fb78 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -208,6 +208,18 @@ static void _print_name(struct seq_file *seq, unsigned int op,
seq_printf(seq, "\t%12u: ", op);
}
+static void _add_rpc_iostats(struct rpc_iostats *a, struct rpc_iostats *b)
+{
+ a->om_ops += b->om_ops;
+ a->om_ntrans += b->om_ntrans;
+ a->om_timeouts += b->om_timeouts;
+ a->om_bytes_sent += b->om_bytes_sent;
+ a->om_bytes_recv += b->om_bytes_recv;
+ a->om_queue = ktime_add(a->om_queue, b->om_queue);
+ a->om_rtt = ktime_add(a->om_rtt, b->om_rtt);
+ a->om_execute = ktime_add(a->om_execute, b->om_execute);
+}
+
static void _print_rpc_iostats(struct seq_file *seq, struct rpc_iostats *stats,
int op, const struct rpc_procinfo *procs)
{