From 47d01546a1826dc14a8331ea8700015f1cfdc4db Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Wed, 6 Dec 2017 14:23:06 +0530 Subject: 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 --- libglusterfs/src/xlator.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libglusterfs/src/xlator.c') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index a342bbd7f33..3e9814ca19b 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -802,6 +802,9 @@ xlator_mem_acct_init (xlator_t *xl, int num_types) if (ret) { fprintf(stderr, "Unable to lock..errno : %d",errno); } +#ifdef DEBUG + INIT_LIST_HEAD(&(xl->mem_acct->rec[i].obj_list)); +#endif } return 0; -- cgit