summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/statedump.h
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2012-09-05 13:07:49 +0530
committerVijay Bellur <vbellur@redhat.com>2012-09-06 04:01:30 -0700
commitbe1d21a8795b215035f546c8da83df205afeb449 (patch)
tree61b40e638ca2bd66348ba68171fd25010c2337db /libglusterfs/src/statedump.h
parentd6c99b6134f1eb90b3a8020c3538101df266e9b5 (diff)
core/statedump: parse the file and set the path of the statedump files
* As of now "gluster volume set statedump-path" option sets the path of the statedump files for brick processes only. If SIGUSR1 is sent directly to all the gluster processes instead of using gluster cli command, then some of the statedumps will still be in /tmp (such as nfs server, glustershd). * This patch makes glusterfs processes search for the file /tmp/glusterdump.options and consider the options given in it. There if path key is set, then all the processes use that path when SIGUSR1 is sent or cli statedump command is executed. (Note that after taking statedump, if /tmp/glusterdump.options file is removed, then the default way is resumed). Change-Id: I2e8fbfb4823318512e03b234e90d3a3888724ddc BUG: 851175 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/3907 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/statedump.h')
-rw-r--r--libglusterfs/src/statedump.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libglusterfs/src/statedump.h b/libglusterfs/src/statedump.h
index 03648ddd9bd..8342b120ada 100644
--- a/libglusterfs/src/statedump.h
+++ b/libglusterfs/src/statedump.h
@@ -31,6 +31,7 @@ typedef struct gf_dump_options_ {
gf_boolean_t dump_iobuf;
gf_boolean_t dump_callpool;
gf_dump_xl_options_t xl_options; //options for all xlators
+ char *dump_path;
} gf_dump_options_t;
extern gf_dump_options_t dump_options;
@@ -55,6 +56,14 @@ void _gf_proc_dump_build_key (char *key, const char *prefix, char *fmt,...)
#define GF_PROC_DUMP_SET_OPTION(opt,val) opt = val
+#define GF_CHECK_DUMP_OPTION_ENABLED(option_dump, var, label) \
+ do { \
+ if (option_dump == _gf_true) { \
+ var = _gf_false; \
+ goto label; \
+ } \
+ } while (0);
+
void gf_proc_dump_init();
void gf_proc_dump_fini(void);