diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-18 12:46:26 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-18 12:46:26 +0000 |
commit | aa4697d8b58e66544daf359a1257e8ab1eb5fce8 (patch) | |
tree | 740e12f5c389ca5aa444ef5b5044fe18125c727b /src/ats-tests/perf_ats.c | |
parent | 719239c84d03b9cdaf0f608a17b0c4c9327a3e25 (diff) | |
download | gnunet-aa4697d8b58e66544daf359a1257e8ab1eb5fce8.tar.gz gnunet-aa4697d8b58e66544daf359a1257e8ab1eb5fce8.zip |
remove unused variable
added basic files for logging
Diffstat (limited to 'src/ats-tests/perf_ats.c')
-rw-r--r-- | src/ats-tests/perf_ats.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c index 4757a78d2..9f4c48f8b 100644 --- a/src/ats-tests/perf_ats.c +++ b/src/ats-tests/perf_ats.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "gnunet_testbed_service.h" | 28 | #include "gnunet_testbed_service.h" |
29 | #include "gnunet_ats_service.h" | 29 | #include "gnunet_ats_service.h" |
30 | #include "gnunet_core_service.h" | 30 | #include "gnunet_core_service.h" |
31 | #include "perf_ats_logging.h" | ||
31 | 32 | ||
32 | #define TEST_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) | 33 | #define TEST_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) |
33 | #define BENCHMARK_DURATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) | 34 | #define BENCHMARK_DURATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) |
@@ -264,6 +265,11 @@ static GNUNET_SCHEDULER_TaskIdentifier progress_task; | |||
264 | */ | 265 | */ |
265 | static int result; | 266 | static int result; |
266 | 267 | ||
268 | /** | ||
269 | * Test result logging | ||
270 | */ | ||
271 | static int logging; | ||
272 | |||
267 | /**Test core (GNUNET_YES) or transport (GNUNET_NO) | 273 | /**Test core (GNUNET_YES) or transport (GNUNET_NO) |
268 | */ | 274 | */ |
269 | static int test_core; | 275 | static int test_core; |
@@ -353,6 +359,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
353 | int c_s; | 359 | int c_s; |
354 | int c_op; | 360 | int c_op; |
355 | 361 | ||
362 | if (GNUNET_YES == logging) | ||
363 | perf_logging_stop(); | ||
364 | |||
356 | shutdown_task = GNUNET_SCHEDULER_NO_TASK; | 365 | shutdown_task = GNUNET_SCHEDULER_NO_TASK; |
357 | if (GNUNET_SCHEDULER_NO_TASK != progress_task) | 366 | if (GNUNET_SCHEDULER_NO_TASK != progress_task) |
358 | { | 367 | { |
@@ -604,6 +613,8 @@ do_benchmark () | |||
604 | if (pref_val != GNUNET_ATS_PREFERENCE_END) | 613 | if (pref_val != GNUNET_ATS_PREFERENCE_END) |
605 | mps[c_m].ats_task = GNUNET_SCHEDULER_add_now (&ats_pref_task, &mps[c_m]); | 614 | mps[c_m].ats_task = GNUNET_SCHEDULER_add_now (&ats_pref_task, &mps[c_m]); |
606 | } | 615 | } |
616 | if (GNUNET_YES == logging) | ||
617 | perf_logging_start(); | ||
607 | } | 618 | } |
608 | 619 | ||
609 | static void | 620 | static void |
@@ -953,8 +964,6 @@ transport_recv_cb (void *cls, | |||
953 | const struct GNUNET_PeerIdentity * peer, | 964 | const struct GNUNET_PeerIdentity * peer, |
954 | const struct GNUNET_MessageHeader * message) | 965 | const struct GNUNET_MessageHeader * message) |
955 | { | 966 | { |
956 | struct BenchmarkPeer *me = cls; | ||
957 | |||
958 | if (TEST_MESSAGE_SIZE != ntohs (message->size) || | 967 | if (TEST_MESSAGE_SIZE != ntohs (message->size) || |
959 | (TEST_MESSAGE_TYPE_PING != ntohs (message->type) && | 968 | (TEST_MESSAGE_TYPE_PING != ntohs (message->type) && |
960 | TEST_MESSAGE_TYPE_PONG != ntohs (message->type))) | 969 | TEST_MESSAGE_TYPE_PONG != ntohs (message->type))) |
@@ -1352,6 +1361,14 @@ main (int argc, char *argv[]) | |||
1352 | else | 1361 | else |
1353 | num_masters = DEFAULT_MASTERS_NUM; | 1362 | num_masters = DEFAULT_MASTERS_NUM; |
1354 | 1363 | ||
1364 | logging = GNUNET_NO; | ||
1365 | for (c = 0; c < argc; c++) | ||
1366 | { | ||
1367 | if (0 == strcmp (argv[c], "-l")) | ||
1368 | logging = GNUNET_YES; | ||
1369 | } | ||
1370 | |||
1371 | |||
1355 | if (num_slaves < num_masters) | 1372 | if (num_slaves < num_masters) |
1356 | { | 1373 | { |
1357 | fprintf (stderr, "Number of master peers is lower than slaves! exit...\n"); | 1374 | fprintf (stderr, "Number of master peers is lower than slaves! exit...\n"); |
@@ -1376,7 +1393,7 @@ main (int argc, char *argv[]) | |||
1376 | event_mask = 0; | 1393 | event_mask = 0; |
1377 | event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT); | 1394 | event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT); |
1378 | event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED); | 1395 | event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED); |
1379 | (void) GNUNET_TESTBED_test_run ("perf_ats", conf_name, | 1396 | (void) GNUNET_TESTBED_test_run ("perf-ats", conf_name, |
1380 | num_slaves + num_masters, event_mask, &controller_event_cb, NULL, | 1397 | num_slaves + num_masters, event_mask, &controller_event_cb, NULL, |
1381 | &main_run, NULL ); | 1398 | &main_run, NULL ); |
1382 | 1399 | ||