summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2016-07-21 11:25:34 -0400
committersueloverso <sue@mongodb.com>2016-07-21 11:25:34 -0400
commitbbc17c2a586d56ff462b237c94a4ebab513a44cc (patch)
tree3caa5bc726ca831de1ca056d661cab503455ec64 /bench
parentf9c5b297944575e902d0fede31b5a0f85ce7fdbf (diff)
downloadmongo-bbc17c2a586d56ff462b237c94a4ebab513a44cc.tar.gz
Fix a set of places where we ignored the return value of a function. (#2893)
Diffstat (limited to 'bench')
-rw-r--r--bench/wtperf/wtperf.c24
-rw-r--r--bench/wtperf/wtperf.h4
-rw-r--r--bench/wtperf/wtperf_throttle.c13
3 files changed, 16 insertions, 25 deletions
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c
index 2dbf14e9f1c..5fae54ed5cf 100644
--- a/bench/wtperf/wtperf.c
+++ b/bench/wtperf/wtperf.c
@@ -79,7 +79,7 @@ static int find_table_count(CONFIG *);
static void *monitor(void *);
static void *populate_thread(void *);
static void randomize_value(CONFIG_THREAD *, char *);
-static int recreate_dir(const char *);
+static void recreate_dir(const char *);
static int start_all_runs(CONFIG *);
static int start_run(CONFIG *);
static int start_threads(CONFIG *,
@@ -478,7 +478,7 @@ do_range_reads(CONFIG *cfg, WT_CURSOR *cursor)
range_key_buf = &buf[0];
/* Save where the first key is for comparisons. */
- cursor->get_key(cursor, &range_key_buf);
+ testutil_check(cursor->get_key(cursor, &range_key_buf));
extract_key(range_key_buf, &next_val);
for (range = 0; range < cfg->read_range; ++range) {
@@ -489,7 +489,7 @@ do_range_reads(CONFIG *cfg, WT_CURSOR *cursor)
break;
/* Retrieve and decode the key */
- cursor->get_key(cursor, &range_key_buf);
+ testutil_check(cursor->get_key(cursor, &range_key_buf));
extract_key(range_key_buf, &next_val);
if (next_val < prev_val) {
lprintf(cfg, EINVAL, 0,
@@ -559,9 +559,8 @@ worker(void *arg)
}
}
/* Setup the timer for throttling. */
- if (thread->workload->throttle != 0 &&
- (ret = setup_throttle(thread)) != 0)
- goto err;
+ if (thread->workload->throttle != 0)
+ setup_throttle(thread);
/* Setup for truncate */
if (thread->workload->truncate != 0)
@@ -2413,10 +2412,8 @@ main(int argc, char *argv[])
goto err;
/* If creating, remove and re-create the home directory. */
- if (cfg->create != 0 && (ret = recreate_dir(cfg->home)) != 0) {
- lprintf(cfg, ret, 0, "Error re-creating home directory");
- goto err;
- }
+ if (cfg->create != 0)
+ recreate_dir(cfg->home);
/* Write a copy of the config. */
config_to_file(cfg);
@@ -2532,7 +2529,7 @@ stop_threads(CONFIG *cfg, u_int num, CONFIG_THREAD *threads)
return (0);
}
-static int
+static void
recreate_dir(const char *name)
{
char *buf;
@@ -2540,12 +2537,9 @@ recreate_dir(const char *name)
len = strlen(name) * 2 + 100;
buf = dmalloc(len);
- (void)snprintf(
- buf, len, "rm -rf %s && mkdir %s", name, name);
+ (void)snprintf(buf, len, "rm -rf %s && mkdir %s", name, name);
testutil_checkfmt(system(buf), "system: %s", buf);
free(buf);
-
- return (0);
}
static int
diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h
index 9f37d361755..27c3832d316 100644
--- a/bench/wtperf/wtperf.h
+++ b/bench/wtperf/wtperf.h
@@ -276,7 +276,7 @@ void latency_print(CONFIG *);
int run_truncate(
CONFIG *, CONFIG_THREAD *, WT_CURSOR *, WT_SESSION *, int *);
int setup_log_file(CONFIG *);
-int setup_throttle(CONFIG_THREAD*);
+void setup_throttle(CONFIG_THREAD*);
int setup_truncate(CONFIG *, CONFIG_THREAD *, WT_SESSION *);
int start_idle_table_cycle(CONFIG *, pthread_t *);
int stop_idle_table_cycle(CONFIG *, pthread_t);
@@ -287,7 +287,7 @@ uint64_t sum_read_ops(CONFIG *);
uint64_t sum_truncate_ops(CONFIG *);
uint64_t sum_update_ops(CONFIG *);
void usage(void);
-int worker_throttle(CONFIG_THREAD*);
+void worker_throttle(CONFIG_THREAD*);
void lprintf(const CONFIG *, int err, uint32_t, const char *, ...)
#if defined(__GNUC__)
diff --git a/bench/wtperf/wtperf_throttle.c b/bench/wtperf/wtperf_throttle.c
index a98fd9b18d7..e49bca00d07 100644
--- a/bench/wtperf/wtperf_throttle.c
+++ b/bench/wtperf/wtperf_throttle.c
@@ -31,7 +31,7 @@
/*
* Put the initial config together for running a throttled workload.
*/
-int
+void
setup_throttle(CONFIG_THREAD *thread)
{
THROTTLE_CONFIG *throttle_cfg;
@@ -70,15 +70,14 @@ setup_throttle(CONFIG_THREAD *thread)
throttle_cfg->ops_count = throttle_cfg->ops_per_increment;
/* Set the first timestamp of when we incremented */
- WT_RET(__wt_epoch(NULL, &throttle_cfg->last_increment));
- return (0);
+ testutil_check(__wt_epoch(NULL, &throttle_cfg->last_increment));
}
/*
* Run the throttle function. We will sleep if needed and then reload the
* counter to perform more operations.
*/
-int
+void
worker_throttle(CONFIG_THREAD *thread)
{
THROTTLE_CONFIG *throttle_cfg;
@@ -87,7 +86,7 @@ worker_throttle(CONFIG_THREAD *thread)
throttle_cfg = &thread->throttle_cfg;
- WT_RET(__wt_epoch(NULL, &now));
+ testutil_check(__wt_epoch(NULL, &now));
/*
* If we did enough operations in the current interval, sleep for
@@ -102,7 +101,7 @@ worker_throttle(CONFIG_THREAD *thread)
/*
* After sleeping, set the interval to the current time.
*/
- WT_RET(__wt_epoch(NULL, &throttle_cfg->last_increment));
+ testutil_check(__wt_epoch(NULL, &throttle_cfg->last_increment));
} else {
throttle_cfg->ops_count = (usecs_delta *
throttle_cfg->ops_per_increment) /
@@ -115,6 +114,4 @@ worker_throttle(CONFIG_THREAD *thread)
*/
throttle_cfg->ops_count =
WT_MIN(throttle_cfg->ops_count, thread->workload->throttle);
-
- return (0);
}