diff options
Diffstat (limited to 'src/datastore/perf_plugin_datastore.c')
-rw-r--r-- | src/datastore/perf_plugin_datastore.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index e6a631b29..4efb684a5 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c | |||
@@ -51,6 +51,8 @@ static unsigned long long stored_entries; | |||
51 | 51 | ||
52 | static unsigned long long stored_ops; | 52 | static unsigned long long stored_ops; |
53 | 53 | ||
54 | static const char *plugin_name; | ||
55 | |||
54 | static int ok; | 56 | static int ok; |
55 | 57 | ||
56 | enum RunPhase | 58 | enum RunPhase |
@@ -365,10 +367,11 @@ run (void *cls, | |||
365 | static int | 367 | static int |
366 | check () | 368 | check () |
367 | { | 369 | { |
370 | char cfg_name[128]; | ||
368 | char *const argv[] = { | 371 | char *const argv[] = { |
369 | "perf-plugin-datastore", | 372 | "perf-plugin-datastore", |
370 | "-c", | 373 | "-c", |
371 | "perf_plugin_datastore_data.conf", | 374 | cfg_name, |
372 | #if VERBOSE | 375 | #if VERBOSE |
373 | "-L", "DEBUG", | 376 | "-L", "DEBUG", |
374 | #endif | 377 | #endif |
@@ -377,6 +380,11 @@ check () | |||
377 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 380 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
378 | GNUNET_GETOPT_OPTION_END | 381 | GNUNET_GETOPT_OPTION_END |
379 | }; | 382 | }; |
383 | |||
384 | GNUNET_snprintf (cfg_name, | ||
385 | sizeof (cfg_name), | ||
386 | "perf_plugin_datastore_data_%s.conf", | ||
387 | plugin_name); | ||
380 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | 388 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, |
381 | argv, "perf-plugin-datastore", "nohelp", | 389 | argv, "perf-plugin-datastore", "nohelp", |
382 | options, &run, NULL); | 390 | options, &run, NULL); |
@@ -390,8 +398,19 @@ int | |||
390 | main (int argc, char *argv[]) | 398 | main (int argc, char *argv[]) |
391 | { | 399 | { |
392 | int ret; | 400 | int ret; |
393 | 401 | const char *pos; | |
394 | GNUNET_DISK_directory_remove ("/tmp/perf-gnunet-datastore"); | 402 | char dir_name[128]; |
403 | |||
404 | /* determine name of plugin to use */ | ||
405 | plugin_name = argv[0]; | ||
406 | while (NULL != (pos = strstr(plugin_name, "_"))) | ||
407 | plugin_name = pos+1; | ||
408 | |||
409 | GNUNET_snprintf (dir_name, | ||
410 | sizeof (dir_name), | ||
411 | "/tmp/perf-gnunet-datastore-%s", | ||
412 | plugin_name); | ||
413 | GNUNET_DISK_directory_remove (dir_name); | ||
395 | GNUNET_log_setup ("perf-plugin-datastore", | 414 | GNUNET_log_setup ("perf-plugin-datastore", |
396 | #if VERBOSE | 415 | #if VERBOSE |
397 | "DEBUG", | 416 | "DEBUG", |
@@ -405,7 +424,6 @@ main (int argc, char *argv[]) | |||
405 | return ret; | 424 | return ret; |
406 | } | 425 | } |
407 | 426 | ||
408 | |||
409 | /* end of perf_plugin_datastore.c */ | 427 | /* end of perf_plugin_datastore.c */ |
410 | 428 | ||
411 | 429 | ||