summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2019-03-13 09:42:33 +0530
committerAtin Mukherjee <amukherj@redhat.com>2019-03-20 07:15:37 +0000
commit6d6a3b298ee81c6c7d93941365852c1bdb42c3c1 (patch)
tree10caeae59125f850a9609861973ca6416cef0fe5 /libglusterfs
parent7413d0c0c20243764858ef817c5e2b42791ff302 (diff)
inode: don't dump the whole table to CLI
dumping the whole inode table detail to screen doesn't solve any purpose. We should be getting only toplevel details on CLI, and then if one wants to debug further, then they need to get to 'statedump' to get full details. Fixes: bz#1580315 Change-Id: Iaf3de94602f9c76832c3c918ffe2ad13c0b0e448 Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/inode.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
index 962b2b4df32..a823110d325 100644
--- a/libglusterfs/src/inode.c
+++ b/libglusterfs/src/inode.c
@@ -2498,6 +2498,11 @@ inode_table_dump_to_dict(inode_table_t *itable, char *prefix, dict_t *dict)
if (ret)
return;
+ snprintf(key, sizeof(key), "%s.itable.lru_limit", prefix);
+ ret = dict_set_uint32(dict, key, itable->lru_limit);
+ if (ret)
+ goto out;
+
snprintf(key, sizeof(key), "%s.itable.active_size", prefix);
ret = dict_set_uint32(dict, key, itable->active_size);
if (ret)
@@ -2513,6 +2518,13 @@ inode_table_dump_to_dict(inode_table_t *itable, char *prefix, dict_t *dict)
if (ret)
goto out;
+#ifdef DEBUG
+ /* Dumping inode details in dictionary and sending it to CLI is not
+ required as when a developer (or support team) asks for this command
+ output, they just want to get top level detail of inode table.
+ If one wants to debug, let them take statedump and debug, this
+ wouldn't be available in CLI during production setup.
+ */
list_for_each_entry(inode, &itable->active, list)
{
snprintf(key, sizeof(key), "%s.itable.active%d", prefix, count++);
@@ -2532,6 +2544,7 @@ inode_table_dump_to_dict(inode_table_t *itable, char *prefix, dict_t *dict)
snprintf(key, sizeof(key), "%s.itable.purge%d", prefix, count++);
inode_dump_to_dict(inode, key, dict);
}
+#endif
out:
pthread_mutex_unlock(&itable->lock);