summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/statedump.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c
index 697ddc3b7ba..a2000b158e6 100644
--- a/libglusterfs/src/statedump.c
+++ b/libglusterfs/src/statedump.c
@@ -376,11 +376,11 @@ gf_proc_dump_mem_info_to_dict (dict_t *dict)
void
gf_proc_dump_mempool_info (glusterfs_ctx_t *ctx)
{
-#if defined(OLD_MEM_POOLS)
struct mem_pool *pool = NULL;
gf_proc_dump_add_section ("mempool");
+#if defined(OLD_MEM_POOLS)
list_for_each_entry (pool, &ctx->mempool_list, global_list) {
gf_proc_dump_write ("-----", "-----");
gf_proc_dump_write ("pool-name", "%s", pool->name);
@@ -395,6 +395,24 @@ gf_proc_dump_mempool_info (glusterfs_ctx_t *ctx)
gf_proc_dump_write ("cur-stdalloc", "%d", pool->curr_stdalloc);
gf_proc_dump_write ("max-stdalloc", "%d", pool->max_stdalloc);
}
+#else
+ LOCK (&ctx->lock);
+ {
+ list_for_each_entry (pool, &ctx->mempool_list, owner) {
+ int64_t active = GF_ATOMIC_GET (pool->active);
+
+ gf_proc_dump_write ("-----", "-----");
+ gf_proc_dump_write ("pool-name", "%s", pool->name);
+ gf_proc_dump_write ("active-count", "%"GF_PRI_ATOMIC, active);
+ gf_proc_dump_write ("sizeof-type", "%d", pool->sizeof_type);
+ gf_proc_dump_write ("padded-sizeof", "%lu", 1 << pool->pool->power_of_two);
+ gf_proc_dump_write ("size", "%lu", (1 << pool->pool->power_of_two) * active);
+ gf_proc_dump_write ("shared-pool", "%p", pool->pool);
+ }
+ }
+ UNLOCK (&ctx->lock);
+
+ /* TODO: details of (struct mem_pool_shared) pool->pool */
#endif
}