diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-04-29 00:27:57 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-04-29 23:10:11 -0700 |
commit | 07744014e26e6c3edb14e624ef2f68c56694375a (patch) | |
tree | 8efd3a1f635eb7e1274f7c3264ef8c6b5e1185e0 | |
parent | 6f1895d77df52f0e0aa7c2a7aff09c9398640aef (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
-rw-r--r-- | xlators/performance/io-cache/src/io-cache.c | 34 |
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 9f402f1dace..f49185ad6e4 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -28,6 +28,7 @@ #include "xlator.h" #include "io-cache.h" #include "ioc-mem-types.h" +#include "statedump.h" #include <assert.h> #include <sys/time.h> @@ -1530,6 +1531,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 - * @@ -1566,6 +1595,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 |