summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorDavid Hows <howsdav@gmail.com>2015-12-15 17:12:19 +1100
committerDavid Hows <howsdav@gmail.com>2015-12-15 17:12:19 +1100
commit57edd66001e6d42a6ac19f2382ade871c0737b17 (patch)
tree77f271779e5b5c0953a35f5e4728be7011601901 /bench
parent6ed7beeae4817543bdd5f4b3b9f3d95a45dfcfaa (diff)
downloadmongo-57edd66001e6d42a6ac19f2382ade871c0737b17.tar.gz
WT-2269 - Change config dump file name. Other test changes
Diffstat (limited to 'bench')
-rw-r--r--bench/wtperf/config.c12
-rw-r--r--bench/wtperf/wtperf.c5
2 files changed, 11 insertions, 6 deletions
diff --git a/bench/wtperf/config.c b/bench/wtperf/config.c
index c3869eb39ee..45ba918f44b 100644
--- a/bench/wtperf/config.c
+++ b/bench/wtperf/config.c
@@ -106,9 +106,17 @@ config_assign(CONFIG *dest, const CONFIG *src)
void
config_free(CONFIG *cfg)
{
+ CONFIG_QUEUE_ENTRY *config_line;
size_t i;
char **pstr;
+ while (!TAILQ_EMPTY(&cfg->config_head)) {
+ config_line = TAILQ_FIRST(&cfg->config_head);
+ TAILQ_REMOVE(&cfg->config_head, config_line, c);
+ free(config_line->string);
+ free(config_line);
+ }
+
for (i = 0; i < sizeof(config_opts) / sizeof(config_opts[0]); i++)
if (config_opts[i].type == STRING_TYPE ||
config_opts[i].type == CONFIG_STRING_TYPE) {
@@ -684,7 +692,7 @@ config_to_file(CONFIG *cfg)
return;
}
- snprintf(path, req_len + 14, "%s/CONFIGBACKUP", cfg->home);
+ snprintf(path, req_len + 14, "%s/CONFIG.wtperf", cfg->home);
if ((fp = fopen(path, "w")) == NULL) {
lprintf(cfg, errno, 0, "%s", path);
return;
@@ -695,8 +703,6 @@ config_to_file(CONFIG *cfg)
config_line = TAILQ_FIRST(&cfg->config_head);
TAILQ_REMOVE(&cfg->config_head, config_line, c);
fprintf(fp, "%s\n", config_line->string);
- free(config_line->string);
- free(config_line);
}
free(path);
fclose(fp);
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c
index 1ee610cfe00..a9411ff0afc 100644
--- a/bench/wtperf/wtperf.c
+++ b/bench/wtperf/wtperf.c
@@ -2311,9 +2311,8 @@ main(int argc, char *argv[])
if ((ret = config_sanity(cfg)) != 0)
goto err;
- /* Save a copy of the config. */
- if (cfg->verbose > 0)
- config_to_file(cfg);
+ /* Write a copy of the config. */
+ config_to_file(cfg);
/* Display the configuration. */
if (cfg->verbose > 1)