summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/mem-pool.h
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-09-19 13:01:26 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-22 04:33:40 -0700
commitb8f2f460f9a5f977ef6debc2e59cae75324c95ca (patch)
tree0df971a6d3838ed4c9abd939822bdb57cda60f7f /libglusterfs/src/mem-pool.h
parent5619b2dc4189e9de4a2327dc63ccb647f863f2b1 (diff)
statedump: add more memory accounting related stats
* iobuf: add variable to keep count of total number of allocations * iobuf: include 'purged' and 'filled' arenas also in dump * mempool: more details added (with a name to tell why mem-pool is created) * memory-accounting: print number of allocs in each type this would give us much better understanding of the memory allocation pattern Change-Id: I117ac0c1da943a4cc91543a01963ba7940db2b5f BUG: 3567 Reviewed-on: http://review.gluster.com/376 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'libglusterfs/src/mem-pool.h')
-rw-r--r--libglusterfs/src/mem-pool.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/libglusterfs/src/mem-pool.h b/libglusterfs/src/mem-pool.h
index 98454c5be6f..a23b122022e 100644
--- a/libglusterfs/src/mem-pool.h
+++ b/libglusterfs/src/mem-pool.h
@@ -39,6 +39,7 @@ struct mem_acct_rec {
size_t size;
size_t max_size;
uint32_t num_allocs;
+ uint32_t total_allocs;
uint32_t max_num_allocs;
gf_lock_t lock;
};
@@ -145,12 +146,16 @@ struct mem_pool {
void *pool;
void *pool_end;
int real_sizeof_type;
+ uint64_t alloc_count;
+ int max_alloc;
+ char *name;
+ struct list_head global_list;
};
struct mem_pool *
-mem_pool_new_fn (unsigned long sizeof_type, unsigned long count);
+mem_pool_new_fn (unsigned long sizeof_type, unsigned long count, char *name);
-#define mem_pool_new(type,count) mem_pool_new_fn (sizeof(type), count)
+#define mem_pool_new(type,count) mem_pool_new_fn (sizeof(type), count, #type)
void mem_put (void *ptr);
void *mem_get (struct mem_pool *pool);