diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-23 14:56:59 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-23 14:56:59 +0000 |
commit | ee1c5c74a2409a52af706e613bd86a26341abba8 (patch) | |
tree | ef18e73357f63737c7560cc3a3ca7fb211bcd468 /src/ats-tests/ats-testing.c | |
parent | 65b732a465152cf0769651397ff9d2c0980e1727 (diff) | |
download | gnunet-ee1c5c74a2409a52af706e613bd86a26341abba8.tar.gz gnunet-ee1c5c74a2409a52af706e613bd86a26341abba8.zip |
new logging functionality
Diffstat (limited to 'src/ats-tests/ats-testing.c')
-rw-r--r-- | src/ats-tests/ats-testing.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/ats-tests/ats-testing.c b/src/ats-tests/ats-testing.c index 3d090c237..08a61367b 100644 --- a/src/ats-tests/ats-testing.c +++ b/src/ats-tests/ats-testing.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file ats-tests/ats-testing.c | 21 | * @file ats-tests/ats-testing.c |
22 | * @brief ats testing library: setup topology and provide logging to test ats | 22 | * @brief ats testing library: setup topology |
23 | * solvers | 23 | * solvers |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | * @author Matthias Wachs | 25 | * @author Matthias Wachs |
@@ -65,9 +65,6 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
65 | int c_op; | 65 | int c_op; |
66 | struct BenchmarkPeer *p; | 66 | struct BenchmarkPeer *p; |
67 | 67 | ||
68 | if (GNUNET_YES == top->logging) | ||
69 | GNUNET_ATS_TEST_logging_stop (); | ||
70 | |||
71 | top->shutdown_task = GNUNET_SCHEDULER_NO_TASK; | 68 | top->shutdown_task = GNUNET_SCHEDULER_NO_TASK; |
72 | top->state.benchmarking = GNUNET_NO; | 69 | top->state.benchmarking = GNUNET_NO; |
73 | 70 | ||
@@ -544,10 +541,13 @@ do_comm_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
544 | } | 541 | } |
545 | 542 | ||
546 | static void | 543 | static void |
547 | ats_performance_info_cb (void *cls, const struct GNUNET_HELLO_Address *address, | 544 | ats_performance_info_cb (void *cls, |
548 | int address_active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 545 | const struct GNUNET_HELLO_Address *address, |
546 | int address_active, | ||
547 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | ||
549 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 548 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
550 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) | 549 | const struct GNUNET_ATS_Information *ats, |
550 | uint32_t ats_count) | ||
551 | { | 551 | { |
552 | struct BenchmarkPeer *me = cls; | 552 | struct BenchmarkPeer *me = cls; |
553 | struct BenchmarkPartner *p; | 553 | struct BenchmarkPartner *p; |
@@ -630,10 +630,8 @@ ats_performance_info_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
630 | break; | 630 | break; |
631 | } | 631 | } |
632 | } | 632 | } |
633 | if ((GNUNET_YES == top->logging) && (GNUNET_YES == log)) | 633 | if (GNUNET_YES == log) |
634 | GNUNET_ATS_TEST_logging_now(); | 634 | top->ats_perf_cb (cls, address, address_active, bandwidth_out, bandwidth_in, |
635 | |||
636 | top->ats_perf_cb (cls, address, address_active, bandwidth_out, bandwidth_in, | ||
637 | ats, ats_count); | 635 | ats, ats_count); |
638 | GNUNET_free(peer_id); | 636 | GNUNET_free(peer_id); |
639 | } | 637 | } |
@@ -843,10 +841,10 @@ GNUNET_ATS_TEST_create_topology (char *name, char *cfg_file, | |||
843 | unsigned int num_slaves, | 841 | unsigned int num_slaves, |
844 | unsigned int num_masters, | 842 | unsigned int num_masters, |
845 | int test_core, | 843 | int test_core, |
846 | GNUNET_ATS_TESTING_TopologySetupDoneCallback done_cb, | 844 | GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb, |
847 | void *done_cb_cls, | 845 | void *done_cb_cls, |
848 | GNUNET_TRANSPORT_ReceiveCallback transport_recv_cb, | 846 | GNUNET_TRANSPORT_ReceiveCallback transport_recv_cb, |
849 | GNUNET_ATS_AddressInformationCallback ats_perf_cb) | 847 | GNUNET_ATS_AddressInformationCallback log_request_cb) |
850 | { | 848 | { |
851 | 849 | ||
852 | static struct GNUNET_CORE_MessageHandler handlers[] = { | 850 | static struct GNUNET_CORE_MessageHandler handlers[] = { |
@@ -862,7 +860,7 @@ GNUNET_ATS_TEST_create_topology (char *name, char *cfg_file, | |||
862 | top->done_cb_cls = done_cb_cls; | 860 | top->done_cb_cls = done_cb_cls; |
863 | top->test_core = test_core; | 861 | top->test_core = test_core; |
864 | top->transport_recv_cb = transport_recv_cb; | 862 | top->transport_recv_cb = transport_recv_cb; |
865 | top->ats_perf_cb = ats_perf_cb; | 863 | top->ats_perf_cb = log_request_cb; |
866 | 864 | ||
867 | top->mps = GNUNET_malloc (num_masters * sizeof (struct BenchmarkPeer)); | 865 | top->mps = GNUNET_malloc (num_masters * sizeof (struct BenchmarkPeer)); |
868 | top->sps = GNUNET_malloc (num_slaves * sizeof (struct BenchmarkPeer)); | 866 | top->sps = GNUNET_malloc (num_slaves * sizeof (struct BenchmarkPeer)); |