From f8d40aad7e21389911b151d6445dd8197bec0049 Mon Sep 17 00:00:00 2001 From: vinayak hegde Date: Tue, 20 Oct 2009 07:17:42 +0000 Subject: performance/quick-read: Process state dump operations are added. Signed-off-by: Anand V. Avati BUG: 213 (Support for process state dump) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=213 --- xlators/performance/quick-read/src/quick-read.c | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'xlators/performance') diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 2c54b559e7c..5c6bfc9c3be 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -18,6 +18,7 @@ */ #include "quick-read.h" +#include "statedump.h" int32_t qr_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, @@ -2127,6 +2128,36 @@ qr_forget (xlator_t *this, inode_t *inode) return 0; } +int +qr_priv_dump (xlator_t *this) +{ + qr_conf_t *conf = NULL; + char key[GF_DUMP_MAX_BUF_LEN]; + char key_prefix[GF_DUMP_MAX_BUF_LEN]; + + if (!this) + return -1; + + conf = this->private; + if (!conf) { + gf_log (this->name, GF_LOG_WARNING, + "conf null in xlator"); + return -1; + } + + gf_proc_dump_build_key (key_prefix, + "xlator.performance.quick-read", + "priv"); + + gf_proc_dump_add_section (key_prefix); + + gf_proc_dump_build_key (key, key_prefix, "max_file_size"); + gf_proc_dump_write (key, "%d", conf->max_file_size); + gf_proc_dump_build_key (key, key_prefix, "cache_timeout"); + gf_proc_dump_write (key, "%d", conf->cache_timeout); + + return 0; +} int32_t init (xlator_t *this) @@ -2227,6 +2258,10 @@ struct xlator_cbks cbks = { .release = qr_release, }; +struct xlator_dumpops dumpops = { + .priv = qr_priv_dump, +}; + struct volume_options options[] = { { .key = {"cache-timeout"}, .type = GF_OPTION_TYPE_INT, -- cgit