diff options
author | vinayak hegde <vinayak@gluster.com> | 2009-10-20 07:17:06 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-20 10:17:53 -0700 |
commit | f90bc2a051ea4d6d23dd4c28ca018fcb1aa9cdaf (patch) | |
tree | f6daa9f677353f734ef0e5d049c7dde01c5a8cdf /xlators/performance/write-behind | |
parent | 4d5ab4c0b8a296e12d80933aad03d06a044c6af2 (diff) |
performance/write-behind: Process state dump operations are added.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 213 (Support for process state dump)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=213
Diffstat (limited to 'xlators/performance/write-behind')
-rw-r--r-- | xlators/performance/write-behind/src/write-behind.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 71eb11543..b67e53c37 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 |