summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-04-29 00:09:50 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-29 23:10:24 -0700
commitc2d13a1685728add650c9bc1760c58cc2da5be1e (patch)
tree530e7c87b9f2a37acc324363f55ec707f0c7bbaa /xlators
parentf55b20076be16d25f48539c4845bc0d59279cd96 (diff)
performance/io-cache: Dump private information
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 828 (glusterdump filled up the /) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=828
Diffstat (limited to 'xlators')
-rw-r--r--xlators/performance/io-cache/src/io-cache.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index 1172f91..9466d29 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -27,6 +27,7 @@
#include "dict.h"
#include "xlator.h"
#include "io-cache.h"
+#include "statedump.h"
#include <assert.h>
#include <sys/time.h>
@@ -1426,6 +1427,34 @@ out:
return ret;
}
+int
+ioc_priv_dump (xlator_t *this)
+{
+ ioc_table_t *priv = NULL;
+ char key_prefix[GF_DUMP_MAX_BUF_LEN];
+ char key[GF_DUMP_MAX_BUF_LEN];
+
+ assert (this);
+ priv = this->private;
+
+ assert (priv);
+
+ gf_proc_dump_build_key (key_prefix, "xlator.performance.io-cache",
+ "priv");
+ gf_proc_dump_add_section (key_prefix);
+
+ gf_proc_dump_build_key (key, key_prefix, "page_size");
+ gf_proc_dump_write (key, "%ld", priv->page_size);
+ gf_proc_dump_build_key (key, key_prefix, "cache_size");
+ gf_proc_dump_write (key, "%ld", priv->cache_size);
+ gf_proc_dump_build_key (key, key_prefix, "cache_used");
+ gf_proc_dump_write (key, "%ld", priv->cache_used);
+ gf_proc_dump_build_key (key, key_prefix, "inode_count");
+ gf_proc_dump_write (key, "%u", priv->inode_count);
+
+ return 0;
+}
+
/*
* fini -
*
@@ -1462,6 +1491,11 @@ struct xlator_fops fops = {
struct xlator_mops mops = {
};
+
+struct xlator_dumpops dumpops = {
+ .priv = ioc_priv_dump,
+};
+
struct xlator_cbks cbks = {
.forget = ioc_forget,
.release = ioc_release