aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorSunil Mushran <sunil.mushran@oracle.com>2010-12-22 15:39:40 -0500
committerJoel Becker <joel.becker@oracle.com>2010-12-22 21:38:09 -0500
commit3c193b3807e933cf2a16d55a38debbe549195847 (patch)
treec44d0656307f0ce00abb2b8102fb6e4bb8ec7d08 /fs/ocfs2
parentff1becbf85bf4d4d4652915b7ab27db949585f6b (diff)
ocfs2/cluster: Track send message timing stats for each socket
Tracks total send and status times for all messages sent on a socket. Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/cluster/tcp.c24
-rw-r--r--fs/ocfs2/cluster/tcp_internal.h6
2 files changed, 30 insertions, 0 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index efd848334052..4d61e19d6146 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -224,6 +224,28 @@ static inline void o2net_set_func_stop_time(struct o2net_sock_container *sc)
224# define o2net_set_func_stop_time(a) 224# define o2net_set_func_stop_time(a)
225#endif /* CONFIG_DEBUG_FS */ 225#endif /* CONFIG_DEBUG_FS */
226 226
227#ifdef CONFIG_OCFS2_FS_STATS
228static void o2net_update_send_stats(struct o2net_send_tracking *nst,
229 struct o2net_sock_container *sc)
230{
231 sc->sc_tv_status_total = ktime_add(sc->sc_tv_status_total,
232 ktime_sub(ktime_get(),
233 nst->st_status_time));
234 sc->sc_tv_send_total = ktime_add(sc->sc_tv_send_total,
235 ktime_sub(nst->st_status_time,
236 nst->st_send_time));
237 sc->sc_tv_acquiry_total = ktime_add(sc->sc_tv_acquiry_total,
238 ktime_sub(nst->st_send_time,
239 nst->st_sock_time));
240 sc->sc_send_count++;
241}
242
243#else
244
245# define o2net_update_send_stats(a, b)
246
247#endif /* CONFIG_OCFS2_FS_STATS */
248
227static inline int o2net_reconnect_delay(void) 249static inline int o2net_reconnect_delay(void)
228{ 250{
229 return o2nm_single_cluster->cl_reconnect_delay_ms; 251 return o2nm_single_cluster->cl_reconnect_delay_ms;
@@ -1093,6 +1115,8 @@ int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *caller_vec,
1093 o2net_set_nst_status_time(&nst); 1115 o2net_set_nst_status_time(&nst);
1094 wait_event(nsw.ns_wq, o2net_nsw_completed(nn, &nsw)); 1116 wait_event(nsw.ns_wq, o2net_nsw_completed(nn, &nsw));
1095 1117
1118 o2net_update_send_stats(&nst, sc);
1119
1096 /* Note that we avoid overwriting the callers status return 1120 /* Note that we avoid overwriting the callers status return
1097 * variable if a system error was reported on the other 1121 * variable if a system error was reported on the other
1098 * side. Callers beware. */ 1122 * side. Callers beware. */
diff --git a/fs/ocfs2/cluster/tcp_internal.h b/fs/ocfs2/cluster/tcp_internal.h
index f81576333911..640c6fcef720 100644
--- a/fs/ocfs2/cluster/tcp_internal.h
+++ b/fs/ocfs2/cluster/tcp_internal.h
@@ -179,6 +179,12 @@ struct o2net_sock_container {
179 ktime_t sc_tv_func_start; 179 ktime_t sc_tv_func_start;
180 ktime_t sc_tv_func_stop; 180 ktime_t sc_tv_func_stop;
181#endif 181#endif
182#ifdef CONFIG_OCFS2_FS_STATS
183 ktime_t sc_tv_acquiry_total;
184 ktime_t sc_tv_send_total;
185 ktime_t sc_tv_status_total;
186 u32 sc_send_count;
187#endif
182 struct mutex sc_send_lock; 188 struct mutex sc_send_lock;
183}; 189};
184 190