From aa71df19383ac15306374ea4992dd59e20f5a9c5 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Mon, 12 Oct 2015 13:12:46 +0530 Subject: features/shard: Dump private members and addresses in statedump Change-Id: I3c5e5bd93288c4c9a2665a26c0d6a76e67ecf914 BUG: 1270694 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/12334 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System Tested-by: NetBSD Build System --- xlators/features/shard/src/shard.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 2c33faf6a5f..6e688427fb4 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -14,6 +14,7 @@ #include "shard-mem-types.h" #include "byte-order.h" #include "defaults.h" +#include "statedump.h" static gf_boolean_t __is_shard_dir (uuid_t gfid) @@ -4450,7 +4451,20 @@ shard_release (xlator_t *this, fd_t *fd) int shard_priv_dump (xlator_t *this) { - /* TBD */ + shard_priv_t *priv = NULL; + char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0,}; + + priv = this->private; + + snprintf (key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, + this->name); + gf_proc_dump_add_section (key_prefix); + gf_proc_dump_write ("shard-block-size", "%s", + gf_uint64_2human_readable (priv->block_size)); + gf_proc_dump_write ("inode-count", "%d", priv->inode_count); + gf_proc_dump_write ("ilist_head", "%p", &priv->ilist_head); + gf_proc_dump_write ("lru-max-limit", "%d", SHARD_MAX_INODES); + return 0; } -- cgit