summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2010-06-01 17:27:18 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-06-07 10:34:56 -0700
commitc4ebd25a176d6d51d702b1009e261c3c27237a48 (patch)
tree119df05127afee492115694f5cce86d132660bc8 /glusterfsd
parentd23ae73d0e34010b464454ce81f53f44901ca544 (diff)
fuse: add a built-in fuse traffic dumper mechanism
It makes fuse dumping possible on platforms where strace is not available (eg. OS X), moreover it makes reporting of fuse related bugs more convenient. Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 972 (Metabug for misc. fuse features) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=972
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c10
-rw-r--r--glusterfsd/src/glusterfsd.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index fa4e1a005..cf486d84f 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -163,6 +163,8 @@ static struct argp_option gf_options[] = {
{"attribute-timeout", ARGP_ATTRIBUTE_TIMEOUT_KEY, "SECONDS", 0,
"Set attribute timeout to SECONDS for inodes in fuse kernel module "
"[default: 1]"},
+ {"dump-fuse", ARGP_DUMP_FUSE_KEY, "PATH", 0,
+ "Dump fuse traffic to PATH"},
{"volfile-check", ARGP_VOLFILE_CHECK_KEY, 0, 0,
"Enable strict volume file checking"},
{0, 0, 0, 0, "Miscellaneous Options:"},
@@ -338,6 +340,10 @@ _add_fuse_mount (xlator_t *graph)
ret = dict_set_int32 (top->options, ZR_STRICT_VOLFILE_CHECK,
cmd_args->volfile_check);
+ if (cmd_args->dump_fuse)
+ ret = dict_set_static_ptr (top->options, ZR_DUMP_FUSE,
+ cmd_args->dump_fuse);
+
#ifdef GF_DARWIN_HOST_OS
/* On Darwin machines, O_APPEND is not handled,
* which may corrupt the data
@@ -1001,6 +1007,10 @@ parse_opts (int key, char *arg, struct argp_state *state)
cmd_args->mount_point = gf_strdup (arg);
break;
+
+ case ARGP_DUMP_FUSE_KEY:
+ cmd_args->dump_fuse = gf_strdup (arg);
+ break;
}
return 0;
diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h
index ec068ec00..929e27d70 100644
--- a/glusterfsd/src/glusterfsd.h
+++ b/glusterfsd/src/glusterfsd.h
@@ -51,6 +51,7 @@
#define ZR_ENTRY_TIMEOUT_OPT "entry-timeout"
#define ZR_DIRECT_IO_OPT "direct-io-mode"
#define ZR_STRICT_VOLFILE_CHECK "strict-volfile-check"
+#define ZR_DUMP_FUSE "dump-fuse"
enum argp_option_keys {
ARGP_VOLFILE_SERVER_KEY = 's',
@@ -79,6 +80,7 @@ enum argp_option_keys {
ARGP_LOG_SERVER_PORT_KEY = 147,
ARGP_READ_ONLY_KEY = 148,
ARGP_MAC_COMPAT_KEY = 149,
+ ARGP_DUMP_FUSE_KEY = 150,
};
/* Moved here from fetch-spec.h */