diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2015-10-12 13:12:46 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-10-13 04:29:48 -0700 |
commit | aa71df19383ac15306374ea4992dd59e20f5a9c5 (patch) | |
tree | 885fe18502236cf22b2ae7f0d521ad36aacdf04d /xlators/features/shard | |
parent | 79c5a715f9bab49f48876ab4f4bc79d211c0d7f1 (diff) |
features/shard: Dump private members and addresses in statedump
Change-Id: I3c5e5bd93288c4c9a2665a26c0d6a76e67ecf914
BUG: 1270694
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/12334
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/features/shard')
-rw-r--r-- | xlators/features/shard/src/shard.c | 16 |
1 files changed, 15 insertions, 1 deletions
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; } |