From af2bf588eaaa918c5c4051baff9e5daf20819f08 Mon Sep 17 00:00:00 2001 From: Susan LoVerso Date: Wed, 17 Feb 2016 13:51:14 -0500 Subject: WT-2349 Add a 'readonly' option to wtperf. --- bench/wtperf/wtperf.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bench/wtperf/wtperf.h') diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h index 929880b0aef..0b0fb88a99c 100644 --- a/bench/wtperf/wtperf.h +++ b/bench/wtperf/wtperf.h @@ -138,6 +138,7 @@ typedef struct { } THROTTLE_CONFIG; #define LOG_PARTIAL_CONFIG ",log=(enabled=false)" +#define READONLY_CONFIG ",readonly=true" /* * NOTE: If you add any fields to this structure here, you must also add * an initialization in wtperf.c in the default_cfg. @@ -146,6 +147,7 @@ struct __config { /* Configuration structure */ const char *home; /* WiredTiger home */ const char *monitor_dir; /* Monitor output dir */ const char *partial_config; /* Config string for partial logging */ + const char *reopen_config; /* Config string for conn reopen */ char *base_uri; /* Object URI */ char **uris; /* URIs if multiple tables */ const char *helium_mount; /* Optional Helium mount point */ -- cgit v1.2.1 From e68f5a2e36cebab58591cb9013224984b3690bdf Mon Sep 17 00:00:00 2001 From: Susan LoVerso Date: Fri, 19 Feb 2016 15:24:25 -0500 Subject: WT-2349 Clean up casts. --- bench/wtperf/wtperf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bench/wtperf/wtperf.h') diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h index 0b0fb88a99c..65ee4963276 100644 --- a/bench/wtperf/wtperf.h +++ b/bench/wtperf/wtperf.h @@ -146,8 +146,8 @@ typedef struct { struct __config { /* Configuration structure */ const char *home; /* WiredTiger home */ const char *monitor_dir; /* Monitor output dir */ - const char *partial_config; /* Config string for partial logging */ - const char *reopen_config; /* Config string for conn reopen */ + char *partial_config; /* Config string for partial logging */ + char *reopen_config; /* Config string for conn reopen */ char *base_uri; /* Object URI */ char **uris; /* URIs if multiple tables */ const char *helium_mount; /* Optional Helium mount point */ -- cgit v1.2.1 From 8a0ffcb3e4e59ee3822df6e559f24ea719e3bca1 Mon Sep 17 00:00:00 2001 From: Alex Gorrod Date: Tue, 1 Mar 2016 05:46:47 +0000 Subject: WT-2366 Extend wtperf to support changing record sizes in update ops Via a new update_delta setting in the thread group which takes either a signed number of "rand" as an argument. Defaults to 0 (disabled). There is also a new value_sz_max configuration option to limit how large values can grow. --- bench/wtperf/wtperf.h | 1 + 1 file changed, 1 insertion(+) (limited to 'bench/wtperf/wtperf.h') diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h index 65ee4963276..6107eaf721d 100644 --- a/bench/wtperf/wtperf.h +++ b/bench/wtperf/wtperf.h @@ -94,6 +94,7 @@ typedef struct { int64_t truncate; /* Truncate ratio */ uint64_t truncate_pct; /* Truncate Percent */ uint64_t truncate_count; /* Truncate Count */ + int64_t update_delta; /* Value size change on update */ #define WORKER_INSERT 1 /* Insert */ #define WORKER_INSERT_RMW 2 /* Insert with read-modify-write */ -- cgit v1.2.1 From 5a47fd78102f26ff85ba353154617772acd8036b Mon Sep 17 00:00:00 2001 From: Susan LoVerso Date: Tue, 1 Mar 2016 16:54:31 -0500 Subject: WT-2366 Add shrink changes. --- bench/wtperf/wtperf.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bench/wtperf/wtperf.h') diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h index 6107eaf721d..c591499b907 100644 --- a/bench/wtperf/wtperf.h +++ b/bench/wtperf/wtperf.h @@ -191,7 +191,10 @@ struct __config { /* Configuration structure */ volatile uint32_t totalsec; /* total seconds running */ - u_int has_truncate; /* if there is a truncate workload */ +#define CFG_GROW 0x0001 /* There is a grow workload */ +#define CFG_SHRINK 0x0002 /* There is a shrink workload */ +#define CFG_TRUNCATE 0x0004 /* There is a truncate workload */ + uint32_t flags; /* flags */ /* Queue head for use with the Truncate Logic */ TAILQ_HEAD(__truncate_qh, __truncate_queue_entry) stone_head; -- cgit v1.2.1 From 5e659cd82c272cdf80df89e10d0e3977075883f9 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Fri, 11 Mar 2016 09:45:23 -0500 Subject: WT-2465: Coverity 1352899: Dereference before null check Don't check for NULL after a dereference, don't bother checking for NULL, dcalloc doesn't return NULL. Change dcalloc arguments to match C library calloc names and usage. --- bench/wtperf/wtperf.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'bench/wtperf/wtperf.h') diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h index c591499b907..60efce650aa 100644 --- a/bench/wtperf/wtperf.h +++ b/bench/wtperf/wtperf.h @@ -370,11 +370,11 @@ dmalloc(size_t len) * Call calloc, dying on failure. */ static inline void * -dcalloc(size_t num, size_t len) +dcalloc(size_t num, size_t size) { void *p; - if ((p = calloc(len, num)) == NULL) + if ((p = calloc(num, size)) == NULL) die(errno, "calloc"); return (p); } @@ -416,11 +416,9 @@ static inline char * dstrndup(const char *str, const size_t len) { char *p; - p = dcalloc(len + 1, 1); - strncpy(p, str, len); - if (p == NULL) - die(errno, "dstrndup"); + p = dcalloc(len + 1, sizeof(char)); + memcpy(p, str, len); return (p); } #endif -- cgit v1.2.1 From 99e2a663aa0c2d4fc7cd1055cde140ce0a06169c Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Mon, 14 Mar 2016 12:54:21 -0400 Subject: WT-2484: Coverity 1345809: unchecked return value Explicitly discard the sscanf return value, hopefully that will quiet Coverity. --- bench/wtperf/wtperf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bench/wtperf/wtperf.h') diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h index 60efce650aa..a2b497b3142 100644 --- a/bench/wtperf/wtperf.h +++ b/bench/wtperf/wtperf.h @@ -337,7 +337,7 @@ generate_key(CONFIG *cfg, char *key_buf, uint64_t keyno) static inline void extract_key(char *key_buf, uint64_t *keynop) { - sscanf(key_buf, "%" SCNu64, keynop); + (void)sscanf(key_buf, "%" SCNu64, keynop); } /* -- cgit v1.2.1