Commit 4b13b221 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

build the liux bdb versions of db-benchmark-test and scanscan. closes #1320

git-svn-id: file:///svn/toku/tokudb.1032b@8300 c7de825b-a66e-492c-adef-691d508d4ae1
parent ca04a5aa
...@@ -22,8 +22,8 @@ include $(TOKUROOT)include/Makefile.include ...@@ -22,8 +22,8 @@ include $(TOKUROOT)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/
ifdef BDBDIR ifdef BDBDIR
BDB_CPPFLAGS = -I$(BDBDIR)/include BDB_CPPFLAGS = -D_GNU_SOURCE -I$(BDBDIR)/include -I../include -I../linux
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb -Wl,-rpath,$(BDBDIR)/lib -lpthread BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb -Wl,-rpath,$(BDBDIR)/lib $(LIBPORTABILITY) -lpthread
else else
BDB_CPPFLAGS = BDB_CPPFLAGS =
BDB_LDFLAGS = -ldb BDB_LDFLAGS = -ldb
...@@ -32,12 +32,14 @@ TOKUDB=libtokudb.$(SOEXT) ...@@ -32,12 +32,14 @@ TOKUDB=libtokudb.$(SOEXT)
TDB_DLINK_FILES = $(TOKUROOT)lib/$(TOKUDB) TDB_DLINK_FILES = $(TOKUROOT)lib/$(TOKUDB)
TARGET_BDB = db-benchmark-test-bdb$(BINSUF) TARGET_BDB = db-benchmark-test-bdb$(BINSUF)
SCANSCAN_BDB = scanscan-bdb$(BINSUF)
TARGET_TDB = db-benchmark-test-tokudb$(BINSUF) TARGET_TDB = db-benchmark-test-tokudb$(BINSUF)
SCANSCAN_TDB = scanscan-tokudb$(BINSUF) SCANSCAN_TDB = scanscan-tokudb$(BINSUF)
TARGETS = $(TARGET_BDB) $(TARGET_TDB) $(SCANSCAN_TDB) TARGETS = $(TARGET_BDB) $(SCANSCAN_BDB) $(TARGET_TDB) $(SCANSCAN_TDB)
default: build default: build
build: $(TARGETS) build: $(TARGETS)
build.bdb: $(TARGET_BDB) $(SCANSCAN_BDB)
build.tdb: $(TARGET_TDB) $(SCANSCAN_TDB) build.tdb: $(TARGET_TDB) $(SCANSCAN_TDB)
check: check-default check-xfast check-x check: check-default check-xfast check-x
...@@ -97,7 +99,9 @@ $(SCANSCAN_TDB): scanscan.c ...@@ -97,7 +99,9 @@ $(SCANSCAN_TDB): scanscan.c
endif endif
$(TARGET_BDB): db-benchmark-test.c $(TARGET_BDB): db-benchmark-test.c
$(CC) $(CFLAGS) $(BDB_CPPFLAGS) $(BDB_LDFLAGS) $< -o $@ -DDIRSUF=bdb $(MAYBEATSIGN)$(CC) $(CFLAGS) $(BDB_CPPFLAGS) $< -o $@ -DDIRSUF=bdb $(BDB_LDFLAGS)
$(SCANSCAN_BDB): scanscan.c
$(MAYBEATSIGN)$(CC) $(CFLAGS) $(BDB_CPPFLAGS) $< -o $@ -DDIRSUF=bdb $(BDB_LDFLAGS)
PARGS = PARGS =
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
/* Insert a bunch of stuff */ /* Insert a bunch of stuff */
#include <toku_portability.h> #include <toku_portability.h>
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
...@@ -55,6 +54,8 @@ static void do_prelock(DB* db, DB_TXN* txn) { ...@@ -55,6 +54,8 @@ static void do_prelock(DB* db, DB_TXN* txn) {
#if !defined(NO_DB_PRELOCKED) #if !defined(NO_DB_PRELOCKED)
int r = db->pre_acquire_table_lock(db, txn); int r = db->pre_acquire_table_lock(db, txn);
assert(r==0); assert(r==0);
#else
db = db; txn = txn;
#endif #endif
} }
} }
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
//#include <sys/resource.h>
//#include <sys/time.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
...@@ -34,8 +32,10 @@ static void parse_args (int argc, const char *argv[]) { ...@@ -34,8 +32,10 @@ static void parse_args (int argc, const char *argv[]) {
if (specified_run_mode && run_mode!=RUN_VERIFY) goto two_modes; if (specified_run_mode && run_mode!=RUN_VERIFY) goto two_modes;
run_mode = RUN_HWC; run_mode = RUN_HWC;
} else if (strcmp(*argv, "--prelock")==0) prelock=1; } else if (strcmp(*argv, "--prelock")==0) prelock=1;
#ifdef TOKUDB
else if (strcmp(*argv, "--prelockflag")==0) { prelockflag=1; lock_flag = DB_PRELOCKED; } else if (strcmp(*argv, "--prelockflag")==0) { prelockflag=1; lock_flag = DB_PRELOCKED; }
else if (strcmp(*argv, "--prelockwriteflag")==0) { prelockflag=1; lock_flag = DB_PRELOCKED_WRITE; } else if (strcmp(*argv, "--prelockwriteflag")==0) { prelockflag=1; lock_flag = DB_PRELOCKED_WRITE; }
#endif
else if (strcmp(*argv, "--nox")==0) { do_txns=0; } else if (strcmp(*argv, "--nox")==0) { do_txns=0; }
else if (strcmp(*argv, "--count")==0) { else if (strcmp(*argv, "--count")==0) {
char *end; char *end;
...@@ -86,6 +86,7 @@ static void scanscan_setup (void) { ...@@ -86,6 +86,7 @@ static void scanscan_setup (void) {
r = env->txn_begin(env, 0, &tid, 0); assert(r==0); r = env->txn_begin(env, 0, &tid, 0); assert(r==0);
} }
r = db->open(db, tid, dbfilename, NULL, DB_BTREE, 0, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); assert(r==0); r = db->open(db, tid, dbfilename, NULL, DB_BTREE, 0, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); assert(r==0);
#ifdef TOKUDB
if (prelock) { if (prelock) {
r = db->pre_acquire_read_lock(db, r = db->pre_acquire_read_lock(db,
tid, tid,
...@@ -93,6 +94,7 @@ static void scanscan_setup (void) { ...@@ -93,6 +94,7 @@ static void scanscan_setup (void) {
db->dbt_pos_infty(), db->dbt_pos_infty()); db->dbt_pos_infty(), db->dbt_pos_infty());
assert(r==0); assert(r==0);
} }
#endif
} }
static void scanscan_shutdown (void) { static void scanscan_shutdown (void) {
...@@ -146,6 +148,8 @@ static void scanscan_hwc (void) { ...@@ -146,6 +148,8 @@ static void scanscan_hwc (void) {
} }
} }
#ifdef TOKUDB
struct extra_count { struct extra_count {
long long totalbytes; long long totalbytes;
int rowcounter; int rowcounter;
...@@ -234,6 +238,7 @@ static void scanscan_verify (void) { ...@@ -234,6 +238,7 @@ static void scanscan_verify (void) {
} }
} }
#endif
int main (int argc, const char *argv[]) { int main (int argc, const char *argv[]) {
...@@ -241,12 +246,14 @@ int main (int argc, const char *argv[]) { ...@@ -241,12 +246,14 @@ int main (int argc, const char *argv[]) {
scanscan_setup(); scanscan_setup();
switch (run_mode) { switch (run_mode) {
case RUN_HWC: scanscan_hwc(); goto ok; case RUN_HWC: scanscan_hwc(); break;
case RUN_LWC: scanscan_lwc(); goto ok; #ifdef TOKUDB
case RUN_VERIFY: scanscan_verify(); goto ok; case RUN_LWC: scanscan_lwc(); break;
case RUN_VERIFY: scanscan_verify(); break;
#else
default: assert(0); break;
#endif
} }
assert(0);
ok:
scanscan_shutdown(); scanscan_shutdown();
#if 0 && defined TOKUDB #if 0 && defined TOKUDB
......
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