diff options
Diffstat (limited to 'src/cadet/gnunet-cadet-profiler.c')
-rw-r--r-- | src/cadet/gnunet-cadet-profiler.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/cadet/gnunet-cadet-profiler.c b/src/cadet/gnunet-cadet-profiler.c index bda844b13..ffa993f8e 100644 --- a/src/cadet/gnunet-cadet-profiler.c +++ b/src/cadet/gnunet-cadet-profiler.c | |||
@@ -249,10 +249,9 @@ static int test_finished; | |||
249 | * on callback funtion ch. | 249 | * on callback funtion ch. |
250 | * | 250 | * |
251 | * @param cls Closure (unsued). | 251 | * @param cls Closure (unsued). |
252 | * @param tc Task Context. | ||
253 | */ | 252 | */ |
254 | static void | 253 | static void |
255 | start_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 254 | start_test (void *cls); |
256 | 255 | ||
257 | 256 | ||
258 | /** | 257 | /** |
@@ -314,10 +313,9 @@ show_end_data (void) | |||
314 | * Shut down peergroup, clean up. | 313 | * Shut down peergroup, clean up. |
315 | * | 314 | * |
316 | * @param cls Closure (unused). | 315 | * @param cls Closure (unused). |
317 | * @param tc Task Context. | ||
318 | */ | 316 | */ |
319 | static void | 317 | static void |
320 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 318 | shutdown_task (void *cls) |
321 | { | 319 | { |
322 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Ending test.\n"); | 320 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Ending test.\n"); |
323 | shutdown_handle = NULL; | 321 | shutdown_handle = NULL; |
@@ -328,10 +326,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
328 | * Disconnect from cadet services af all peers, call shutdown. | 326 | * Disconnect from cadet services af all peers, call shutdown. |
329 | * | 327 | * |
330 | * @param cls Closure (unused). | 328 | * @param cls Closure (unused). |
331 | * @param tc Task Context. | ||
332 | */ | 329 | */ |
333 | static void | 330 | static void |
334 | disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 331 | disconnect_cadet_peers (void *cls) |
335 | { | 332 | { |
336 | long line = (long) cls; | 333 | long line = (long) cls; |
337 | unsigned int i; | 334 | unsigned int i; |
@@ -443,11 +440,13 @@ stats_iterator (void *cls, const struct GNUNET_TESTBED_Peer *peer, | |||
443 | * Task check that keepalives were sent and received. | 440 | * Task check that keepalives were sent and received. |
444 | * | 441 | * |
445 | * @param cls Closure (NULL). | 442 | * @param cls Closure (NULL). |
446 | * @param tc Task Context. | ||
447 | */ | 443 | */ |
448 | static void | 444 | static void |
449 | collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 445 | collect_stats (void *cls) |
450 | { | 446 | { |
447 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
448 | |||
449 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
451 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) | 450 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) |
452 | return; | 451 | return; |
453 | 452 | ||
@@ -462,11 +461,13 @@ collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
462 | * @brief Finish profiler normally. Signal finish and start collecting stats. | 461 | * @brief Finish profiler normally. Signal finish and start collecting stats. |
463 | * | 462 | * |
464 | * @param cls Closure (unused). | 463 | * @param cls Closure (unused). |
465 | * @param tc Task context. | ||
466 | */ | 464 | */ |
467 | static void | 465 | static void |
468 | finish_profiler (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 466 | finish_profiler (void *cls) |
469 | { | 467 | { |
468 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
469 | |||
470 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
470 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) | 471 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) |
471 | return; | 472 | return; |
472 | 473 | ||
@@ -542,11 +543,13 @@ adjust_running_peers (unsigned int target) | |||
542 | * @brief Move to next round. | 543 | * @brief Move to next round. |
543 | * | 544 | * |
544 | * @param cls Closure (round #). | 545 | * @param cls Closure (round #). |
545 | * @param tc Task context. | ||
546 | */ | 546 | */ |
547 | static void | 547 | static void |
548 | next_rnd (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 548 | next_rnd (void *cls) |
549 | { | 549 | { |
550 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
551 | |||
552 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
550 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) | 553 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) |
551 | return; | 554 | return; |
552 | 555 | ||
@@ -608,15 +611,15 @@ tmt_rdy_pong (void *cls, size_t size, void *buf) | |||
608 | * @brief Send a ping to destination | 611 | * @brief Send a ping to destination |
609 | * | 612 | * |
610 | * @param cls Closure (peer). | 613 | * @param cls Closure (peer). |
611 | * @param tc Task context. | ||
612 | */ | 614 | */ |
613 | static void | 615 | static void |
614 | ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 616 | ping (void *cls) |
615 | { | 617 | { |
616 | struct CadetPeer *peer = (struct CadetPeer *) cls; | 618 | struct CadetPeer *peer = cls; |
619 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
617 | 620 | ||
618 | peer->ping_task = NULL; | 621 | peer->ping_task = NULL; |
619 | 622 | tc = GNUNET_SCHEDULER_get_task_context (); | |
620 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) | 623 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) |
621 | || GNUNET_YES == test_finished) | 624 | || GNUNET_YES == test_finished) |
622 | return; | 625 | return; |
@@ -865,15 +868,16 @@ select_random_peer (struct CadetPeer *peer) | |||
865 | * on callback funtion ch. | 868 | * on callback funtion ch. |
866 | * | 869 | * |
867 | * @param cls Closure (unsued). | 870 | * @param cls Closure (unsued). |
868 | * @param tc Task Context. | ||
869 | */ | 871 | */ |
870 | static void | 872 | static void |
871 | start_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 873 | start_test (void *cls) |
872 | { | 874 | { |
873 | enum GNUNET_CADET_ChannelOption flags; | 875 | enum GNUNET_CADET_ChannelOption flags; |
874 | unsigned long i; | 876 | unsigned long i; |
877 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
875 | 878 | ||
876 | test_task = NULL; | 879 | test_task = NULL; |
880 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
877 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) | 881 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) |
878 | return; | 882 | return; |
879 | 883 | ||
@@ -1089,4 +1093,3 @@ main (int argc, char *argv[]) | |||
1089 | } | 1093 | } |
1090 | 1094 | ||
1091 | /* end of gnunet-cadet-profiler.c */ | 1095 | /* end of gnunet-cadet-profiler.c */ |
1092 | |||