Commit 4c28875d authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Integrate the scanrace test into the makefile. Addresses #1470, #1469.

git-svn-id: file:///svn/toku/tokudb@9431 c7de825b-a66e-492c-adef-691d508d4ae1
parent 04d722c1
......@@ -19,7 +19,7 @@ SKIP_NORETURN=1 #Do not add the -Wmissing-noreturn flag
HERE = db-benchmark-test
include $(TOKUROOT)toku_include/Makefile.include
BENCHDBS = bench.bdb/ bench.tokudb ptest*.dir/ x.dir/ xfast.dir/
BENCHDBS = bench.bdb/ bench.tokudb ptest*.dir/ x.dir/ xfast.dir/ scanrace.tokudb/
ifdef BDBDIR
BDB_CPPFLAGS = -D_GNU_SOURCE -I$(BDBDIR)/include -I../include
......@@ -45,7 +45,7 @@ build: $(TARGETS)
build.bdb: $(TARGET_BDB) $(SCANSCAN_BDB)
build.tdb: $(TARGET_TDB) $(SCANSCAN_TDB)
check: check-default check-xfast check-x check-no-rolltmp
check: check-default check-xfast check-x check-no-rolltmp check-scanrace
check-default: $(TARGET_TDB)
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) $(SUMMARIZE_CMD)
......@@ -53,6 +53,10 @@ check-default: $(TARGET_TDB)
check-x: $(TARGET_TDB)
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) -x --xcount 1000 --periter 100000 --env x.dir 10 $(SUMMARIZE_CMD)
# Warning, this cannot actually run in parallel with the other tests since it uses the same env
check-scanrace: $(SCANRACE_TDB) $(TARGET_TDB)
./$(TARGET_TDB) --env scanrace.tokudb 1
$(VGRIND) ./$(SCANRACE_TDB) --env scanrace.tokudb $(SUMMARIZE_CMD)
# A fast transaction test that detects #455.
check-xfast: $(TARGET_TDB)
......
......@@ -17,6 +17,11 @@ static const char *pname;
static long limitcount=-1;
static u_int32_t cachesize = 4*1024*1024;
#define STRINGIFY2(s) #s
#define STRINGIFY(s) STRINGIFY2(s)
const char *dbdir = "./bench." STRINGIFY(DIRSUF); /* DIRSUF is passed in as a -D argument to the compiler. */
static void parse_args (int argc, const char *argv[]) {
pname=argv[0];
argc--;
......@@ -31,10 +36,16 @@ static void parse_args (int argc, const char *argv[]) {
char *end;
argv++; argc--;
cachesize=(u_int32_t)strtol(*argv, &end, 10);
} else if (strcmp(*argv, "--env") == 0) {
argv++; argc--;
if (argc <= 0) goto print_usage;
dbdir = *argv;
} else {
print_usage:
fprintf(stderr, "Usage:\n%s\n", pname);
fprintf(stderr, " --count <count> read the first COUNT rows and then stop.\n");
fprintf(stderr, " --cachesize <n> set the env cachesize to <n>\n");
fprintf(stderr, " --env DIR\n");
exit(1);
}
argc--;
......@@ -47,11 +58,8 @@ DB_ENV *env;
DB *db;
DB_TXN *tid=0;
#define STRINGIFY2(s) #s
#define STRINGIFY(s) STRINGIFY2(s)
const char *dbdir = "./bench." STRINGIFY(DIRSUF); /* DIRSUF is passed in as a -D argument to the compiler. */
int env_open_flags_yesx = DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOG|DB_INIT_LOCK;
int env_open_flags_nox = DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL;
static int env_open_flags_yesx = DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOG|DB_INIT_LOCK;
char *dbfilename = "bench.db";
static void scanrace_setup (void) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment