From a941b19e5d747a5468b3c10d4a1c95f539c476ac Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 19 Jun 2012 12:43:08 +0930 Subject: ntdb: reduce default hashsize on ntdbtorture. Just like tdbtorture, having a hashsize of 2 stresses us much more! Signed-off-by: Rusty Russell --- lib/ntdb/tools/ntdbtorture.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/ntdb') diff --git a/lib/ntdb/tools/ntdbtorture.c b/lib/ntdb/tools/ntdbtorture.c index d611563a7a..717f5dd1f5 100644 --- a/lib/ntdb/tools/ntdbtorture.c +++ b/lib/ntdb/tools/ntdbtorture.c @@ -46,6 +46,7 @@ static int loopnum; static int count_pipe; static union ntdb_attribute log_attr; static union ntdb_attribute seed_attr; +static union ntdb_attribute hsize_attr; static void ntdb_log(struct ntdb_context *ntdb, enum ntdb_log_level level, @@ -247,7 +248,7 @@ static void usage(void) #if TRANSACTION_PROB " [-t]" #endif - " [-k] [-n NUM_PROCS] [-l NUM_LOOPS] [-s SEED] [-S]\n"); + " [-k] [-n NUM_PROCS] [-l NUM_LOOPS] [-s SEED] [-S] [-H HASH_SIZE]\n"); exit(0); } @@ -364,9 +365,12 @@ int main(int argc, char * const *argv) log_attr.base.next = &seed_attr; log_attr.log.fn = ntdb_log; seed_attr.base.attr = NTDB_ATTRIBUTE_SEED; - seed_attr.base.next = NULL; + seed_attr.base.next = &hsize_attr; + hsize_attr.base.attr = NTDB_ATTRIBUTE_HASHSIZE; + hsize_attr.base.next = NULL; + hsize_attr.hashsize.size = 2; /* stress it by default. */ - while ((c = getopt(argc, argv, "n:l:s:thkS")) != -1) { + while ((c = getopt(argc, argv, "n:l:s:thkSH:")) != -1) { switch (c) { case 'n': num_procs = strtol(optarg, NULL, 0); @@ -391,6 +395,9 @@ int main(int argc, char * const *argv) case 'k': kill_random = 1; break; + case 'H': + hsize_attr.hashsize.size = strtol(optarg, NULL, 0); + break; default: usage(); } -- cgit