bench: make io.c file path configurable
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 12 Feb 2013 18:37:30 +0000 (19:37 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Tue, 12 Feb 2013 18:38:29 +0000 (19:38 +0100)
benchmark/io.c

index a4f4575..66d90d5 100644 (file)
@@ -14,7 +14,7 @@
  
 static int c = 0;
 static int tsize = 1000 * 1048576;
-static const char path[] = "/tmp/wt.dat";
+static const char* path = "/tmp/wt.dat";
 static char buf[65536];
 
 static uint64_t now(void) {
@@ -106,11 +106,13 @@ void cleanup() {
   unlink(path);
 }
 
-int main()
+int main(int argc, char** argv)
 {
   int i;
   int bsizes[] = {1024, 4096, 8192, 16384, 32768, 65536, 0};
 
+  if (argc > 1) path = argv[1];
+
   for (i = 0; bsizes[i] != 0; i++) {
     writetest(tsize, bsizes[i]);
   }