From f90bc2a051ea4d6d23dd4c28ca018fcb1aa9cdaf Mon Sep 17 00:00:00 2001 From: vinayak hegde Date: Tue, 20 Oct 2009 07:17:06 +0000 Subject: performance/write-behind: 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 --- .../performance/write-behind/src/write-behind.c | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'xlators/performance/write-behind') diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 71eb115435d..b67e53c370c 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -34,6 +34,7 @@ #include "compat-errno.h" #include "common-utils.h" #include "call-stub.h" +#include "statedump.h" #define MAX_VECTOR_COUNT 8 #define WB_AGGREGATE_SIZE 131072 /* 128 KB */ @@ -2373,6 +2374,44 @@ wb_release (xlator_t *this, fd_t *fd) return 0; } +int +wb_priv_dump (xlator_t *this) +{ + wb_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.write-behind", + "priv"); + + gf_proc_dump_add_section (key_prefix); + + gf_proc_dump_build_key (key, key_prefix, "aggregate_size"); + gf_proc_dump_write (key, "%d", conf->aggregate_size); + gf_proc_dump_build_key (key, key_prefix, "window_size"); + gf_proc_dump_write (key, "%d", conf->window_size); + gf_proc_dump_build_key (key, key_prefix, "disable_till"); + gf_proc_dump_write (key, "%d", conf->disable_till); + gf_proc_dump_build_key (key, key_prefix, "enable_O_SYNC"); + gf_proc_dump_write (key, "%d", conf->enable_O_SYNC); + gf_proc_dump_build_key (key, key_prefix, "flush_behind"); + gf_proc_dump_write (key, "%d", conf->flush_behind); + gf_proc_dump_build_key (key, key_prefix, "enable_trickling_writes"); + gf_proc_dump_write (key, "%d", conf->enable_trickling_writes); + + return 0; +} int32_t init (xlator_t *this) @@ -2542,6 +2581,10 @@ struct xlator_cbks cbks = { .release = wb_release }; +struct xlator_dumpops dumpops = { + .priv = wb_priv_dump, +}; + struct volume_options options[] = { { .key = {"flush-behind"}, .type = GF_OPTION_TYPE_BOOL -- cgit