diff options
Diffstat (limited to 'src/transport/gnunet-transport-profiler.c')
-rw-r--r-- | src/transport/gnunet-transport-profiler.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c index 89f5b4108..d4f8589d1 100644 --- a/src/transport/gnunet-transport-profiler.c +++ b/src/transport/gnunet-transport-profiler.c | |||
@@ -195,7 +195,7 @@ shutdown_task (void *cls) | |||
195 | } | 195 | } |
196 | 196 | ||
197 | if (verbosity > 0) | 197 | if (verbosity > 0) |
198 | FPRINTF (stdout, "\n"); | 198 | fprintf (stdout, "\n"); |
199 | 199 | ||
200 | /* Output format: | 200 | /* Output format: |
201 | * All time values in ms | 201 | * All time values in ms |
@@ -216,7 +216,7 @@ shutdown_task (void *cls) | |||
216 | icur->rate = ((benchmark_count * benchmark_size) / 1024) / | 216 | icur->rate = ((benchmark_count * benchmark_size) / 1024) / |
217 | ((float) icur->dur.rel_value_us / (1000 * 1000)); | 217 | ((float) icur->dur.rel_value_us / (1000 * 1000)); |
218 | if (verbosity > 0) | 218 | if (verbosity > 0) |
219 | FPRINTF (stdout, | 219 | fprintf (stdout, |
220 | _ ("%llu B in %llu ms == %.2f KB/s!\n"), | 220 | _ ("%llu B in %llu ms == %.2f KB/s!\n"), |
221 | ((long long unsigned int) benchmark_count * benchmark_size), | 221 | ((long long unsigned int) benchmark_count * benchmark_size), |
222 | ((long long unsigned int) icur->dur.rel_value_us / 1000), | 222 | ((long long unsigned int) icur->dur.rel_value_us / 1000), |
@@ -252,7 +252,7 @@ shutdown_task (void *cls) | |||
252 | stddev_duration = sqrtf (stddev_duration); | 252 | stddev_duration = sqrtf (stddev_duration); |
253 | 253 | ||
254 | /* Output */ | 254 | /* Output */ |
255 | FPRINTF (stdout, | 255 | fprintf (stdout, |
256 | "%u;%u;%llu;%llu;%.2f;%.2f", | 256 | "%u;%u;%llu;%llu;%.2f;%.2f", |
257 | benchmark_count, | 257 | benchmark_count, |
258 | benchmark_size, | 258 | benchmark_size, |
@@ -267,7 +267,7 @@ shutdown_task (void *cls) | |||
267 | inext = icur->next; | 267 | inext = icur->next; |
268 | GNUNET_CONTAINER_DLL_remove (ihead, itail, icur); | 268 | GNUNET_CONTAINER_DLL_remove (ihead, itail, icur); |
269 | 269 | ||
270 | FPRINTF (stdout, | 270 | fprintf (stdout, |
271 | ";%llu;%.2f", | 271 | ";%llu;%.2f", |
272 | (long long unsigned int) (icur->dur.rel_value_us / 1000), | 272 | (long long unsigned int) (icur->dur.rel_value_us / 1000), |
273 | icur->rate); | 273 | icur->rate); |
@@ -279,14 +279,14 @@ shutdown_task (void *cls) | |||
279 | if (benchmark_receive) | 279 | if (benchmark_receive) |
280 | { | 280 | { |
281 | duration = GNUNET_TIME_absolute_get_duration (start_time); | 281 | duration = GNUNET_TIME_absolute_get_duration (start_time); |
282 | FPRINTF (stdout, | 282 | fprintf (stdout, |
283 | "Received %llu bytes/s (%llu bytes in %s)\n", | 283 | "Received %llu bytes/s (%llu bytes in %s)\n", |
284 | 1000LL * 1000LL * traffic_received / (1 + duration.rel_value_us), | 284 | 1000LL * 1000LL * traffic_received / (1 + duration.rel_value_us), |
285 | traffic_received, | 285 | traffic_received, |
286 | GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES)); | 286 | GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES)); |
287 | } | 287 | } |
288 | #endif | 288 | #endif |
289 | FPRINTF (stdout, "\n"); | 289 | fprintf (stdout, "\n"); |
290 | } | 290 | } |
291 | 291 | ||
292 | 292 | ||
@@ -326,7 +326,7 @@ send_msg (void *cls) | |||
326 | } | 326 | } |
327 | GNUNET_MQ_send (mq, env); | 327 | GNUNET_MQ_send (mq, env); |
328 | if ((verbosity > 0) && (0 == itail->msgs_sent % 10)) | 328 | if ((verbosity > 0) && (0 == itail->msgs_sent % 10)) |
329 | FPRINTF (stdout, "."); | 329 | fprintf (stdout, "."); |
330 | } | 330 | } |
331 | 331 | ||
332 | 332 | ||
@@ -343,7 +343,7 @@ iteration_start () | |||
343 | GNUNET_CONTAINER_DLL_insert_tail (ihead, itail, icur); | 343 | GNUNET_CONTAINER_DLL_insert_tail (ihead, itail, icur); |
344 | icur->start = GNUNET_TIME_absolute_get (); | 344 | icur->start = GNUNET_TIME_absolute_get (); |
345 | if (verbosity > 0) | 345 | if (verbosity > 0) |
346 | FPRINTF ( | 346 | fprintf ( |
347 | stdout, | 347 | stdout, |
348 | "\nStarting benchmark, starting to send %u messages in %u byte blocks\n", | 348 | "\nStarting benchmark, starting to send %u messages in %u byte blocks\n", |
349 | benchmark_count, | 349 | benchmark_count, |
@@ -385,12 +385,12 @@ notify_connect (void *cls, | |||
385 | { | 385 | { |
386 | if (0 != memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity))) | 386 | if (0 != memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity))) |
387 | { | 387 | { |
388 | FPRINTF (stdout, "Connected to different peer `%s'\n", GNUNET_i2s (&pid)); | 388 | fprintf (stdout, "Connected to different peer `%s'\n", GNUNET_i2s (&pid)); |
389 | return NULL; | 389 | return NULL; |
390 | } | 390 | } |
391 | 391 | ||
392 | if (verbosity > 0) | 392 | if (verbosity > 0) |
393 | FPRINTF (stdout, "Successfully connected to `%s'\n", GNUNET_i2s (&pid)); | 393 | fprintf (stdout, "Successfully connected to `%s'\n", GNUNET_i2s (&pid)); |
394 | mq = m; | 394 | mq = m; |
395 | iteration_start (); | 395 | iteration_start (); |
396 | return NULL; | 396 | return NULL; |
@@ -415,7 +415,7 @@ notify_disconnect (void *cls, | |||
415 | mq = NULL; | 415 | mq = NULL; |
416 | if (GNUNET_YES == benchmark_running) | 416 | if (GNUNET_YES == benchmark_running) |
417 | { | 417 | { |
418 | FPRINTF (stdout, | 418 | fprintf (stdout, |
419 | "Disconnected from peer `%s' while benchmarking\n", | 419 | "Disconnected from peer `%s' while benchmarking\n", |
420 | GNUNET_i2s (&pid)); | 420 | GNUNET_i2s (&pid)); |
421 | return; | 421 | return; |
@@ -449,7 +449,7 @@ handle_dummy (void *cls, const struct GNUNET_MessageHeader *message) | |||
449 | if (! benchmark_receive) | 449 | if (! benchmark_receive) |
450 | return; | 450 | return; |
451 | if (verbosity > 0) | 451 | if (verbosity > 0) |
452 | FPRINTF (stdout, | 452 | fprintf (stdout, |
453 | "Received %u bytes\n", | 453 | "Received %u bytes\n", |
454 | (unsigned int) ntohs (message->size)); | 454 | (unsigned int) ntohs (message->size)); |
455 | } | 455 | } |
@@ -461,7 +461,7 @@ blacklist_cb (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
461 | if (0 != memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity))) | 461 | if (0 != memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity))) |
462 | { | 462 | { |
463 | if (verbosity > 0) | 463 | if (verbosity > 0) |
464 | FPRINTF (stdout, "Denying connection to `%s'\n", GNUNET_i2s (peer)); | 464 | fprintf (stdout, "Denying connection to `%s'\n", GNUNET_i2s (peer)); |
465 | return GNUNET_SYSERR; | 465 | return GNUNET_SYSERR; |
466 | } | 466 | } |
467 | return GNUNET_OK; | 467 | return GNUNET_OK; |
@@ -494,26 +494,26 @@ run (void *cls, | |||
494 | ret = 1; | 494 | ret = 1; |
495 | if (GNUNET_MAX_MESSAGE_SIZE <= benchmark_size) | 495 | if (GNUNET_MAX_MESSAGE_SIZE <= benchmark_size) |
496 | { | 496 | { |
497 | FPRINTF (stderr, "Message size too big!\n"); | 497 | fprintf (stderr, "Message size too big!\n"); |
498 | return; | 498 | return; |
499 | } | 499 | } |
500 | 500 | ||
501 | if (NULL == cpid) | 501 | if (NULL == cpid) |
502 | { | 502 | { |
503 | FPRINTF (stderr, "No peer identity given\n"); | 503 | fprintf (stderr, "No peer identity given\n"); |
504 | return; | 504 | return; |
505 | } | 505 | } |
506 | if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (cpid, | 506 | if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (cpid, |
507 | strlen (cpid), | 507 | strlen (cpid), |
508 | &pid.public_key)) | 508 | &pid.public_key)) |
509 | { | 509 | { |
510 | FPRINTF (stderr, "Failed to parse peer identity `%s'\n", cpid); | 510 | fprintf (stderr, "Failed to parse peer identity `%s'\n", cpid); |
511 | return; | 511 | return; |
512 | } | 512 | } |
513 | if (1 == benchmark_send) | 513 | if (1 == benchmark_send) |
514 | { | 514 | { |
515 | if (verbosity > 0) | 515 | if (verbosity > 0) |
516 | FPRINTF (stderr, | 516 | fprintf (stderr, |
517 | "Trying to send %u messages with size %u to peer `%s'\n", | 517 | "Trying to send %u messages with size %u to peer `%s'\n", |
518 | benchmark_count, | 518 | benchmark_count, |
519 | benchmark_size, | 519 | benchmark_size, |
@@ -521,20 +521,20 @@ run (void *cls, | |||
521 | } | 521 | } |
522 | else if (1 == benchmark_receive) | 522 | else if (1 == benchmark_receive) |
523 | { | 523 | { |
524 | FPRINTF (stderr, | 524 | fprintf (stderr, |
525 | "Trying to receive messages from peer `%s'\n", | 525 | "Trying to receive messages from peer `%s'\n", |
526 | GNUNET_i2s (&pid)); | 526 | GNUNET_i2s (&pid)); |
527 | } | 527 | } |
528 | else | 528 | else |
529 | { | 529 | { |
530 | FPRINTF (stderr, "No operation given\n"); | 530 | fprintf (stderr, "No operation given\n"); |
531 | return; | 531 | return; |
532 | } | 532 | } |
533 | 533 | ||
534 | ats = GNUNET_ATS_connectivity_init (cfg); | 534 | ats = GNUNET_ATS_connectivity_init (cfg); |
535 | if (NULL == ats) | 535 | if (NULL == ats) |
536 | { | 536 | { |
537 | FPRINTF (stderr, "Failed to connect to ATS service\n"); | 537 | fprintf (stderr, "Failed to connect to ATS service\n"); |
538 | ret = 1; | 538 | ret = 1; |
539 | return; | 539 | return; |
540 | } | 540 | } |
@@ -548,7 +548,7 @@ run (void *cls, | |||
548 | NULL); | 548 | NULL); |
549 | if (NULL == handle) | 549 | if (NULL == handle) |
550 | { | 550 | { |
551 | FPRINTF (stderr, "Failed to connect to transport service\n"); | 551 | fprintf (stderr, "Failed to connect to transport service\n"); |
552 | GNUNET_ATS_connectivity_done (ats); | 552 | GNUNET_ATS_connectivity_done (ats); |
553 | ats = NULL; | 553 | ats = NULL; |
554 | ret = 1; | 554 | ret = 1; |