aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/perf_plugin_datastore.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-08-03 12:17:43 +0000
committerChristian Grothoff <christian@grothoff.org>2010-08-03 12:17:43 +0000
commit9efe0ce2c8b51f34b815e34d5f73fc180639581f (patch)
tree3fd6391fb5d4dd8ed9785f7f6e21d5d913c8eaa4 /src/datastore/perf_plugin_datastore.c
parent5c70edfcef3121b1523f9cc39d9f0a1c94b0166e (diff)
mysql plugin compiles now -- not complete
Diffstat (limited to 'src/datastore/perf_plugin_datastore.c')
-rw-r--r--src/datastore/perf_plugin_datastore.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c
index e6a631b29c..4efb684a5a 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;
static unsigned long long stored_ops;
+static const char *plugin_name;
+
static int ok;
enum RunPhase
@@ -365,10 +367,11 @@ run (void *cls,
static int
check ()
{
+ char cfg_name[128];
char *const argv[] = {
"perf-plugin-datastore",
"-c",
- "perf_plugin_datastore_data.conf",
+ cfg_name,
#if VERBOSE
"-L", "DEBUG",
#endif
@@ -377,6 +380,11 @@ check ()
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
+
+ GNUNET_snprintf (cfg_name,
+ sizeof (cfg_name),
+ "perf_plugin_datastore_data_%s.conf",
+ plugin_name);
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
argv, "perf-plugin-datastore", "nohelp",
options, &run, NULL);
@@ -390,8 +398,19 @@ int
main (int argc, char *argv[])
{
int ret;
-
- GNUNET_DISK_directory_remove ("/tmp/perf-gnunet-datastore");
+ const char *pos;
+ char dir_name[128];
+
+ /* determine name of plugin to use */
+ plugin_name = argv[0];
+ while (NULL != (pos = strstr(plugin_name, "_")))
+ plugin_name = pos+1;
+
+ GNUNET_snprintf (dir_name,
+ sizeof (dir_name),
+ "/tmp/perf-gnunet-datastore-%s",
+ plugin_name);
+ GNUNET_DISK_directory_remove (dir_name);
GNUNET_log_setup ("perf-plugin-datastore",
#if VERBOSE
"DEBUG",
@@ -405,7 +424,6 @@ main (int argc, char *argv[])
return ret;
}
-
/* end of perf_plugin_datastore.c */