diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-23 15:10:08 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-23 15:10:08 +0000 |
commit | d10f54d435d545b4fdafd4ffa278f786b5f500dc (patch) | |
tree | 48165dcd5c4e6e2ee9ca67b3d023bb505c24049c /src/ats-tests/perf_ats.c | |
parent | ee1c5c74a2409a52af706e613bd86a26341abba8 (diff) | |
download | gnunet-d10f54d435d545b4fdafd4ffa278f786b5f500dc.tar.gz gnunet-d10f54d435d545b4fdafd4ffa278f786b5f500dc.zip |
fixing test case logging
Diffstat (limited to 'src/ats-tests/perf_ats.c')
-rw-r--r-- | src/ats-tests/perf_ats.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c index 08b6a1518..7e835495c 100644 --- a/src/ats-tests/perf_ats.c +++ b/src/ats-tests/perf_ats.c | |||
@@ -117,6 +117,8 @@ static unsigned int num_slaves; | |||
117 | */ | 117 | */ |
118 | static struct BenchmarkPeer *sps; | 118 | static struct BenchmarkPeer *sps; |
119 | 119 | ||
120 | static struct LoggingHandle *l; | ||
121 | |||
120 | static void | 122 | static void |
121 | evaluate () | 123 | evaluate () |
122 | { | 124 | { |
@@ -190,7 +192,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
190 | { | 192 | { |
191 | 193 | ||
192 | if (GNUNET_YES == logging) | 194 | if (GNUNET_YES == logging) |
193 | GNUNET_ATS_TEST_logging_stop(); | 195 | GNUNET_ATS_TEST_logging_stop(l); |
194 | 196 | ||
195 | shutdown_task = GNUNET_SCHEDULER_NO_TASK; | 197 | shutdown_task = GNUNET_SCHEDULER_NO_TASK; |
196 | if (GNUNET_SCHEDULER_NO_TASK != progress_task) | 198 | if (GNUNET_SCHEDULER_NO_TASK != progress_task) |
@@ -269,7 +271,7 @@ start_benchmark() | |||
269 | } | 271 | } |
270 | 272 | ||
271 | if (GNUNET_YES == logging) | 273 | if (GNUNET_YES == logging) |
272 | GNUNET_ATS_TEST_logging_start(log_frequency, testname, mps, num_masters); | 274 | l = GNUNET_ATS_TEST_logging_start(log_frequency, testname, mps, num_masters); |
273 | } | 275 | } |
274 | 276 | ||
275 | static void | 277 | static void |
@@ -313,7 +315,7 @@ test_recv_cb (void *cls, | |||
313 | 315 | ||
314 | 316 | ||
315 | static void | 317 | static void |
316 | ats_performance_info_cb (void *cls, const struct GNUNET_HELLO_Address *address, | 318 | log_request_cb (void *cls, const struct GNUNET_HELLO_Address *address, |
317 | int address_active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 319 | int address_active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
318 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 320 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
319 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) | 321 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) |
@@ -321,7 +323,6 @@ ats_performance_info_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
321 | struct BenchmarkPeer *me = cls; | 323 | struct BenchmarkPeer *me = cls; |
322 | struct BenchmarkPartner *p; | 324 | struct BenchmarkPartner *p; |
323 | int c_a; | 325 | int c_a; |
324 | int log; | ||
325 | char *peer_id; | 326 | char *peer_id; |
326 | 327 | ||
327 | p = find_partner (me, &address->peer); | 328 | p = find_partner (me, &address->peer); |
@@ -334,10 +335,8 @@ ats_performance_info_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
334 | } | 335 | } |
335 | peer_id = GNUNET_strdup (GNUNET_i2s (&me->id)); | 336 | peer_id = GNUNET_strdup (GNUNET_i2s (&me->id)); |
336 | 337 | ||
337 | log = GNUNET_NO; | ||
338 | if ((p->bandwidth_in != ntohl (bandwidth_in.value__)) || | 338 | if ((p->bandwidth_in != ntohl (bandwidth_in.value__)) || |
339 | (p->bandwidth_out != ntohl (bandwidth_out.value__))) | 339 | (p->bandwidth_out != ntohl (bandwidth_out.value__))) |
340 | log = GNUNET_YES; | ||
341 | p->bandwidth_in = ntohl (bandwidth_in.value__); | 340 | p->bandwidth_in = ntohl (bandwidth_in.value__); |
342 | p->bandwidth_out = ntohl (bandwidth_out.value__); | 341 | p->bandwidth_out = ntohl (bandwidth_out.value__); |
343 | 342 | ||
@@ -351,7 +350,8 @@ ats_performance_info_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
351 | ntohl(ats[c_a].value)); | 350 | ntohl(ats[c_a].value)); |
352 | } | 351 | } |
353 | GNUNET_free(peer_id); | 352 | GNUNET_free(peer_id); |
354 | 353 | if (NULL != l) | |
354 | GNUNET_ATS_TEST_logging_now (l); | ||
355 | } | 355 | } |
356 | 356 | ||
357 | 357 | ||
@@ -544,7 +544,7 @@ main (int argc, char *argv[]) | |||
544 | &do_benchmark, | 544 | &do_benchmark, |
545 | NULL, | 545 | NULL, |
546 | &test_recv_cb, | 546 | &test_recv_cb, |
547 | &ats_performance_info_cb); | 547 | &log_request_cb); |
548 | 548 | ||
549 | return result; | 549 | return result; |
550 | } | 550 | } |