diff options
author | shishir gowda <shishirng@gluster.com> | 2012-04-09 16:29:45 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-12 22:16:06 -0700 |
commit | ea8378299e4d9ae5a8d296feb1d16950d07173de (patch) | |
tree | a25f9d0d687f194c73b50d9e3f15cc3ed9f34950 /xlators | |
parent | 122da53bd1a82eaaf4aeb2ce6443fe8d0fe3ab46 (diff) |
glusterd/rebalance: Provide option start rebalance with valgrind
Change-Id: Ia7a836425f5dbfe07b2e46563e49aaeaaaaa4e14
BUG: 810836
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/3108
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rebalance.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index 84be4073751..b25fc598b1f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c +++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c @@ -261,7 +261,9 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr, char pidfile[PATH_MAX] = {0,}; char logfile[PATH_MAX] = {0,}; dict_t *options = NULL; - +#ifdef DEBUG + char valgrind_logfile[PATH_MAX] = {0,}; +#endif priv = THIS->private; GF_ASSERT (volinfo); @@ -311,6 +313,19 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr, snprintf (logfile, PATH_MAX, "%s/%s-rebalance.log", DEFAULT_LOG_FILE_DIRECTORY, volinfo->volname); runinit (&runner); +#ifdef DEBUG + if (priv->valgrind) { + snprintf (valgrind_logfile, PATH_MAX, + "%s/valgrind-%s-rebalance.log", + DEFAULT_LOG_FILE_DIRECTORY, + volinfo->volname); + + runner_add_args (&runner, "valgrind", "--leak-check=full", + "--trace-children=yes", NULL); + runner_argprintf (&runner, "--log-file=%s", valgrind_logfile); + } +#endif + runner_add_args (&runner, SBIN_DIR"/glusterfs", "-s", "localhost", "--volfile-id", volinfo->volname, "--xlator-option", "*dht.use-readdirp=yes", |