Commit 83a91302 authored by Rusty Russell's avatar Rusty Russell

Add handling of reduced test cases (traverse lines trimmed), and add all the...

Add handling of reduced test cases (traverse lines trimmed), and add all the test cases I've been using.
parent 29efaaee
......@@ -10,5 +10,20 @@ replay_trace: replay_trace.c keywords.c
keywords.c: keywords.gperf
gperf $< > $@
check: replay_trace
@rm -f *.reduced_trace
@set -e; for f in tests/*.trace.tar.bz2; do \
tar xvfj $$f; \
./replay_trace replay.tdb *.reduced_trace; \
rm -f *.reduced_trace; \
done
# Usage: make mytest.trace.tar.bz2 TRACEFILES=*.trace
%.trace.tar.bz2: $(patsubst %.trace,%.reduced_trace,$(wildcard $(TRACEFILES)))
tar cvfj $@ $^
%.reduced_trace: %.trace
@sed 's/\(^[0-9]* traverse\) .*/\1fn/' < $^ > $@
clean:
rm -f replay_trace tdbtorture tdbdump *.o
......@@ -61,10 +61,10 @@ hash_keyword (register const char *str, register unsigned int len)
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 15, 51, 25,
5, 0, 10, 0, 0, 51, 51, 0, 0, 0,
15, 51, 15, 51, 51, 0, 5, 0, 51, 0,
51, 15, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 20, 51, 25,
5, 0, 0, 5, 5, 51, 51, 0, 0, 0,
20, 51, 20, 51, 51, 0, 5, 0, 51, 0,
51, 5, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
......@@ -93,7 +93,7 @@ find_keyword (register const char *str, register unsigned int len)
{
enum
{
TOTAL_KEYWORDS = 32,
TOTAL_KEYWORDS = 33,
MIN_WORD_LENGTH = 8,
MAX_WORD_LENGTH = 25,
MIN_HASH_VALUE = 8,
......@@ -115,17 +115,18 @@ find_keyword (register const char *str, register unsigned int len)
{"tdb_wipe_all", OP_TDB_WIPE_ALL, op_add_nothing,},
#line 20 "keywords.gperf"
{"tdb_unlockall", OP_TDB_UNLOCKALL, op_add_nothing,},
#line 35 "keywords.gperf"
{"tdb_get_seqnum", OP_TDB_GET_SEQNUM, op_add_seqnum,},
#line 47 "keywords.gperf"
{"tdb_fetch", OP_TDB_FETCH, op_add_key_data,},
#line 48 "keywords.gperf"
{"tdb_delete", OP_TDB_DELETE, op_add_key_ret,},
#line 17 "keywords.gperf"
{"tdb_lockall_mark", OP_TDB_LOCKALL_MARK, op_add_nothing,},
{""},
#line 45 "keywords.gperf"
{"tdb_firstkey", OP_TDB_FIRSTKEY, op_add_key,},
#line 18 "keywords.gperf"
{"tdb_lockall_unmark", OP_TDB_LOCKALL_UNMARK, op_add_nothing,},
#line 46 "keywords.gperf"
{"tdb_fetch", OP_TDB_FETCH, op_add_key_data,},
#line 35 "keywords.gperf"
{"tdb_get_seqnum", OP_TDB_GET_SEQNUM, op_add_seqnum,},
#line 19 "keywords.gperf"
{"tdb_lockall_nonblock", OP_TDB_LOCKALL_NONBLOCK, op_add_nothing,},
#line 21 "keywords.gperf"
......@@ -143,26 +144,27 @@ find_keyword (register const char *str, register unsigned int len)
#line 41 "keywords.gperf"
{"tdb_traverse_start", OP_TDB_TRAVERSE_START, op_add_traverse_start,},
{""},
#line 34 "keywords.gperf"
{"tdb_append", OP_TDB_APPEND, op_add_append,},
#line 44 "keywords.gperf"
{"traversefn", OP_TDB_TRAVERSE, op_add_traversefn,},
#line 37 "keywords.gperf"
{"tdb_transaction_start", OP_TDB_TRANSACTION_START, op_add_transaction,},
#line 39 "keywords.gperf"
{"tdb_transaction_commit", OP_TDB_TRANSACTION_COMMIT, op_analyze_transaction,},
#line 40 "keywords.gperf"
{"tdb_traverse_read_start", OP_TDB_TRAVERSE_READ_START, op_add_traverse_start,},
{""}, {""},
#line 31 "keywords.gperf"
{"tdb_parse_record", OP_TDB_PARSE_RECORD, op_add_key_ret,},
#line 44 "keywords.gperf"
{"tdb_firstkey", OP_TDB_FIRSTKEY, op_add_key,},
{""},
#line 34 "keywords.gperf"
{"tdb_append", OP_TDB_APPEND, op_add_append,},
#line 46 "keywords.gperf"
{"tdb_nextkey", OP_TDB_NEXTKEY, op_add_key_data,},
{""},
#line 24 "keywords.gperf"
{"tdb_chainlock", OP_TDB_CHAINLOCK, op_add_chainlock,},
{""},
#line 28 "keywords.gperf"
{"tdb_chainunlock", OP_TDB_CHAINUNLOCK, op_analyze_chainlock,},
#line 45 "keywords.gperf"
{"tdb_nextkey", OP_TDB_NEXTKEY, op_add_key_data,},
#line 31 "keywords.gperf"
{"tdb_parse_record", OP_TDB_PARSE_RECORD, op_add_key_ret,},
{""},
#line 26 "keywords.gperf"
{"tdb_chainlock_mark", OP_TDB_CHAINLOCK_MARK, op_add_key,},
......
......@@ -41,6 +41,7 @@ tdb_traverse_read_start, OP_TDB_TRAVERSE_READ_START, op_add_traverse_start,
tdb_traverse_start, OP_TDB_TRAVERSE_START, op_add_traverse_start,
tdb_traverse_end, OP_TDB_TRAVERSE_END, op_analyze_traverse,
traverse, OP_TDB_TRAVERSE, op_add_traverse,
traversefn, OP_TDB_TRAVERSE, op_add_traversefn,
tdb_firstkey, OP_TDB_FIRSTKEY, op_add_key,
tdb_nextkey, OP_TDB_NEXTKEY, op_add_key_data,
tdb_fetch, OP_TDB_FETCH, op_add_key_data,
......
......@@ -253,6 +253,16 @@ static void op_add_traverse(const char *filename,
op[op_num].key = tdb_null;
}
/* Full traverse info is useful for debugging, but changing it to
* "traversefn" without the data makes the traces *much* smaller! */
static void op_add_traversefn(const char *filename,
struct op op[], unsigned int op_num, char *words[])
{
if (words[2])
fail(filename, op_num+1, "Expected no values");
op[op_num].key = tdb_null;
}
/* <serial> tdb_store <rec> <rec> <flag> = <ret> */
static void op_add_store(const char *filename,
struct op op[], unsigned int op_num, char *words[])
......
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