diff options
author | Weston Andros Adamson <dros@netapp.com> | 2012-02-17 13:15:24 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-02-17 13:39:47 -0500 |
commit | 0a702195234eb77c4097148285cccf7f095de9cf (patch) | |
tree | 40fead6b131fb3c24e3cd85e39fbba8057196457 /net | |
parent | b6bf6e7d6f6fae1ddcae9e02dfe676bdc8fe892c (diff) |
NFS: include filelayout DS rpc stats in mountstats
Include RPC statistics from all data servers in /proc/self/mountstats for pNFS
filelayout mounts.
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/stats.c | 8 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 3c4f6888c891..1eb3304bc105 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
@@ -133,20 +133,19 @@ EXPORT_SYMBOL_GPL(rpc_free_iostats); | |||
133 | /** | 133 | /** |
134 | * rpc_count_iostats - tally up per-task stats | 134 | * rpc_count_iostats - tally up per-task stats |
135 | * @task: completed rpc_task | 135 | * @task: completed rpc_task |
136 | * @stats: array of stat structures | ||
136 | * | 137 | * |
137 | * Relies on the caller for serialization. | 138 | * Relies on the caller for serialization. |
138 | */ | 139 | */ |
139 | void rpc_count_iostats(struct rpc_task *task) | 140 | void rpc_count_iostats(const struct rpc_task *task, struct rpc_iostats *stats) |
140 | { | 141 | { |
141 | struct rpc_rqst *req = task->tk_rqstp; | 142 | struct rpc_rqst *req = task->tk_rqstp; |
142 | struct rpc_iostats *stats; | ||
143 | struct rpc_iostats *op_metrics; | 143 | struct rpc_iostats *op_metrics; |
144 | ktime_t delta; | 144 | ktime_t delta; |
145 | 145 | ||
146 | if (!task->tk_client || !task->tk_client->cl_metrics || !req) | 146 | if (!stats || !req) |
147 | return; | 147 | return; |
148 | 148 | ||
149 | stats = task->tk_client->cl_metrics; | ||
150 | op_metrics = &stats[task->tk_msg.rpc_proc->p_statidx]; | 149 | op_metrics = &stats[task->tk_msg.rpc_proc->p_statidx]; |
151 | 150 | ||
152 | op_metrics->om_ops++; | 151 | op_metrics->om_ops++; |
@@ -164,6 +163,7 @@ void rpc_count_iostats(struct rpc_task *task) | |||
164 | delta = ktime_sub(ktime_get(), task->tk_start); | 163 | delta = ktime_sub(ktime_get(), task->tk_start); |
165 | op_metrics->om_execute = ktime_add(op_metrics->om_execute, delta); | 164 | op_metrics->om_execute = ktime_add(op_metrics->om_execute, delta); |
166 | } | 165 | } |
166 | EXPORT_SYMBOL_GPL(rpc_count_iostats); | ||
167 | 167 | ||
168 | static void _print_name(struct seq_file *seq, unsigned int op, | 168 | static void _print_name(struct seq_file *seq, unsigned int op, |
169 | struct rpc_procinfo *procs) | 169 | struct rpc_procinfo *procs) |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 739df8a11382..32e37945a840 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -1137,7 +1137,10 @@ void xprt_release(struct rpc_task *task) | |||
1137 | return; | 1137 | return; |
1138 | 1138 | ||
1139 | xprt = req->rq_xprt; | 1139 | xprt = req->rq_xprt; |
1140 | rpc_count_iostats(task); | 1140 | if (task->tk_ops->rpc_count_stats != NULL) |
1141 | task->tk_ops->rpc_count_stats(task, task->tk_calldata); | ||
1142 | else if (task->tk_client) | ||
1143 | rpc_count_iostats(task, task->tk_client->cl_metrics); | ||
1141 | spin_lock_bh(&xprt->transport_lock); | 1144 | spin_lock_bh(&xprt->transport_lock); |
1142 | xprt->ops->release_xprt(xprt, task); | 1145 | xprt->ops->release_xprt(xprt, task); |
1143 | if (xprt->ops->release_request) | 1146 | if (xprt->ops->release_request) |