aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-12-03 16:58:57 -0500
committerSteve French <sfrench@us.ibm.com>2005-12-03 16:58:57 -0500
commit4498eed50a114565debd38f173acd62cce6e7cb8 (patch)
tree8a94482e9a7b98bb32aab518a0fce74075eabd2f
parent84afc29b185334f489975a003b128e1b15e24a54 (diff)
[CIFS] Add extended stats (STATS2) for total buffer allocations for
better performance debugging. Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r--fs/cifs/cifs_debug.c4
-rw-r--r--fs/cifs/cifsfs.c6
-rw-r--r--fs/cifs/cifsglob.h8
-rw-r--r--fs/cifs/misc.c7
4 files changed, 23 insertions, 2 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 22a444a3fe4c..7f19f2547d01 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -219,6 +219,10 @@ cifs_stats_write(struct file *file, const char __user *buffer,
219 219
220 if (c == '1' || c == 'y' || c == 'Y' || c == '0') { 220 if (c == '1' || c == 'y' || c == 'Y' || c == '0') {
221 read_lock(&GlobalSMBSeslock); 221 read_lock(&GlobalSMBSeslock);
222#ifdef CONFIG_CIFS_STATS2
223 atomic_set(&totBufAllocCount, 0);
224 atomic_set(&totSmBufAllocCount, 0);
225#endif /* CONFIG_CIFS_STATS2 */
222 list_for_each(tmp, &GlobalTreeConnectionList) { 226 list_for_each(tmp, &GlobalTreeConnectionList) {
223 tcon = list_entry(tmp, struct cifsTconInfo, 227 tcon = list_entry(tmp, struct cifsTconInfo,
224 cifsConnectionList); 228 cifsConnectionList);
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 2a13a2bac8f1..ba90903909a6 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -954,6 +954,12 @@ init_cifs(void)
954 atomic_set(&tconInfoReconnectCount, 0); 954 atomic_set(&tconInfoReconnectCount, 0);
955 955
956 atomic_set(&bufAllocCount, 0); 956 atomic_set(&bufAllocCount, 0);
957 atomic_set(&smBufAllocCount, 0);
958#ifdef CONFIG_CIFS_STATS2
959 atomic_set(&totBufAllocCount, 0);
960 atomic_set(&totSmBufAllocCount, 0);
961#endif /* CONFIG_CIFS_STATS2 */
962
957 atomic_set(&midCount, 0); 963 atomic_set(&midCount, 0);
958 GlobalCurrentXid = 0; 964 GlobalCurrentXid = 0;
959 GlobalTotalActiveXid = 0; 965 GlobalTotalActiveXid = 0;
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 1ba08f8c5bc4..c011c278af4c 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -505,8 +505,12 @@ GLOBAL_EXTERN atomic_t tcpSesReconnectCount;
505GLOBAL_EXTERN atomic_t tconInfoReconnectCount; 505GLOBAL_EXTERN atomic_t tconInfoReconnectCount;
506 506
507/* Various Debug counters to remove someday (BB) */ 507/* Various Debug counters to remove someday (BB) */
508GLOBAL_EXTERN atomic_t bufAllocCount; 508GLOBAL_EXTERN atomic_t bufAllocCount; /* current number allocated */
509GLOBAL_EXTERN atomic_t smBufAllocCount; 509#ifdef CONFIG_CIFS_STATS2
510GLOBAL_EXTERN atomic_t totBufAllocCount; /* total allocated over all time */
511GLOBAL_EXTERN atomic_t totSmBufAllocCount;
512#endif
513GLOBAL_EXTERN atomic_t smBufAllocCount;
510GLOBAL_EXTERN atomic_t midCount; 514GLOBAL_EXTERN atomic_t midCount;
511 515
512/* Misc globals */ 516/* Misc globals */
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 9af37f864688..ac5a72a299a3 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -161,6 +161,9 @@ cifs_buf_get(void)
161 if (ret_buf) { 161 if (ret_buf) {
162 memset(ret_buf, 0, sizeof(struct smb_hdr) + 3); 162 memset(ret_buf, 0, sizeof(struct smb_hdr) + 3);
163 atomic_inc(&bufAllocCount); 163 atomic_inc(&bufAllocCount);
164#ifdef CONFIG_CIFS_STATS2
165 atomic_inc(&totBufAllocCount);
166#endif /* CONFIG_CIFS_STATS2 */
164 } 167 }
165 168
166 return ret_buf; 169 return ret_buf;
@@ -195,6 +198,10 @@ cifs_small_buf_get(void)
195 /* No need to clear memory here, cleared in header assemble */ 198 /* No need to clear memory here, cleared in header assemble */
196 /* memset(ret_buf, 0, sizeof(struct smb_hdr) + 27);*/ 199 /* memset(ret_buf, 0, sizeof(struct smb_hdr) + 27);*/
197 atomic_inc(&smBufAllocCount); 200 atomic_inc(&smBufAllocCount);
201#ifdef CONFIG_CIFS_STATS2
202 atomic_inc(&totSmBufAllocCount);
203#endif /* CONFIG_CIFS_STATS2 */
204
198 } 205 }
199 return ret_buf; 206 return ret_buf;
200} 207}