diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-08-05 13:32:17 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-08-05 13:32:17 +0000 |
commit | 80e91cc2d8e19a1aeead110ac1ac813d85247fd3 (patch) | |
tree | 5a0610b710db07361659aa86d57e64cf4eba1126 | |
parent | 72947853f7e945a53b8d8902b0caaaf5f2f8c98a (diff) |
confs and makefile
-rw-r--r-- | src/ats/Makefile.am | 4 | ||||
-rw-r--r-- | src/ats/perf_ats.c | 47 | ||||
-rw-r--r-- | src/ats/perf_ats_simplistic_bandwidth.conf | 0 | ||||
-rw-r--r-- | src/ats/perf_ats_simplistic_delay.conf | 0 |
4 files changed, 42 insertions, 9 deletions
diff --git a/src/ats/Makefile.am b/src/ats/Makefile.am index 1d9a115187..40450d7f08 100644 --- a/src/ats/Makefile.am +++ b/src/ats/Makefile.am @@ -264,4 +264,6 @@ perf_ats_simplistic_delay_LDADD = \ EXTRA_DIST = \ ats.h \ test_ats_api.conf \ - test_ats_mlp.conf + test_ats_mlp.conf \ + perf_ats_simplistic_bandwidth.conf \ + perf_ats_simplistic_delay.conf diff --git a/src/ats/perf_ats.c b/src/ats/perf_ats.c index 1576361b75..5072c30a54 100644 --- a/src/ats/perf_ats.c +++ b/src/ats/perf_ats.c @@ -19,19 +19,24 @@ */ /** * @file ats/test_ats.c - * @brief ats benchmark + * @brief ats benchmark: start peers and modify preferences, monitor change over time * @author Christian Grothoff * @author Matthias Wachs */ #include "platform.h" #include "gnunet_util_lib.h" +#define TESTNAME_PREFIX "perf_ats_" + static int ret; +static char *solver; +static char *preference; static void check (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Benchmarking solver `%s' on preference `%s'\n"), solver, preference); ret = 0; } @@ -39,13 +44,9 @@ check (void *cls, char *const *args, const char *cfgfile, int main (int argc, char *argv[]) { - - static char *const argv2[] = { "perf_ats", - "-c", - "perf_ats.conf", - "-L", "WARNING", - NULL - }; + char *tmp; + char *tmp_sep; + char *conf_name; ret = 1; @@ -53,10 +54,40 @@ main (int argc, char *argv[]) GNUNET_GETOPT_OPTION_END }; + /* figure out testname */ + tmp = strstr (argv[0], TESTNAME_PREFIX); + if (NULL == tmp) + { + fprintf (stderr, "Unable to parse test name `%s'\n", argv[0]); + return GNUNET_SYSERR; + } + tmp += strlen(TESTNAME_PREFIX); + solver = GNUNET_strdup (tmp); + tmp_sep = strchr (solver, '_'); + if (NULL == tmp_sep) + { + fprintf (stderr, "Unable to parse test name `%s'\n", argv[0]); + GNUNET_free (solver); + return GNUNET_SYSERR; + } + tmp_sep[0] = '\0'; + preference = GNUNET_strdup(tmp_sep + 1); + + GNUNET_asprintf(&conf_name, "%s%s_%s.conf", TESTNAME_PREFIX, solver, preference); + + char *argv2[] = { "perf_ats", + "-c", + conf_name, + "-L", "WARNING", + NULL + }; GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2, "perf_ats", "nohelp", options, &check, NULL); + GNUNET_free (solver); + GNUNET_free (preference); + GNUNET_free (conf_name); return ret; } diff --git a/src/ats/perf_ats_simplistic_bandwidth.conf b/src/ats/perf_ats_simplistic_bandwidth.conf new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/src/ats/perf_ats_simplistic_bandwidth.conf diff --git a/src/ats/perf_ats_simplistic_delay.conf b/src/ats/perf_ats_simplistic_delay.conf new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/src/ats/perf_ats_simplistic_delay.conf |