summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/mem-pool.h
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2017-12-08 08:41:13 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2017-12-08 14:40:31 +0000
commitaae8eaa8104197652d487042a66fddd850da72f3 (patch)
treeec402ae6854f2bf4d5ab9b91a47644d9df592ffc /libglusterfs/src/mem-pool.h
parent7359ecec6a8919a15dc1ce3bef3ab99d0898414f (diff)
core/memacct: save allocs in mem_acct_rec list
With configure --enable-debug, add all object allocations to a list in the corresponding mem_acct_rec. This allows us to see all objects of a particular type and allows for additional debugging in case of memory leaks. This is not compiled in by default and must be explicitly enabled. It is intended to be used by developers. > Change-Id: I7cf2dbeadecf994423d7e7591e85f18d2575cce8 > BUG: 1522662 > Signed-off-by: N Balachandran <nbalacha@redhat.com> (cherry picked from commit 47d01546a1826dc14a8331ea8700015f1cfdc4db) Change-Id: I7cf2dbeadecf994423d7e7591e85f18d2575cce8 BUG: 1523455 Signed-off-by: N Balachandran <nbalacha@redhat.com>
Diffstat (limited to 'libglusterfs/src/mem-pool.h')
-rw-r--r--libglusterfs/src/mem-pool.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfs/src/mem-pool.h b/libglusterfs/src/mem-pool.h
index 1272ad4d5fc..8bf38ca3aff 100644
--- a/libglusterfs/src/mem-pool.h
+++ b/libglusterfs/src/mem-pool.h
@@ -45,6 +45,9 @@ struct mem_acct_rec {
uint32_t total_allocs;
uint32_t max_num_allocs;
gf_lock_t lock;
+#ifdef DEBUG
+ struct list_head obj_list;
+#endif
};
struct mem_acct {
@@ -58,6 +61,9 @@ struct mem_header {
size_t size;
struct mem_acct *mem_acct;
uint32_t magic;
+#ifdef DEBUG
+ struct list_head acct_list;
+#endif
int padding[8];
};