diff options
| author | vinayak hegde <vinayak@gluster.com> | 2009-10-20 07:17:42 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-20 10:17:58 -0700 | 
| commit | f8d40aad7e21389911b151d6445dd8197bec0049 (patch) | |
| tree | 6057a7496ef534d58784ad69a37040eb060187cb /xlators/performance/quick-read/src/quick-read.c | |
| parent | f90bc2a051ea4d6d23dd4c28ca018fcb1aa9cdaf (diff) | |
performance/quick-read: 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/quick-read/src/quick-read.c')
| -rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 35 | 
1 files changed, 35 insertions, 0 deletions
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,  | 
