diff options
Diffstat (limited to 'src/dht/gnunet_dht_profiler.c')
-rw-r--r-- | src/dht/gnunet_dht_profiler.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c index 7d6ac685a..f0c4ec7be 100644 --- a/src/dht/gnunet_dht_profiler.c +++ b/src/dht/gnunet_dht_profiler.c | |||
@@ -406,28 +406,30 @@ static int in_shutdown = 0; | |||
406 | */ | 406 | */ |
407 | static unsigned int tries; | 407 | static unsigned int tries; |
408 | 408 | ||
409 | |||
409 | /** | 410 | /** |
410 | * Task that collects successor statistics from all the peers. | 411 | * Task that collects successor statistics from all the peers. |
412 | * | ||
411 | * @param cls | 413 | * @param cls |
412 | * @param tc | ||
413 | */ | 414 | */ |
414 | static void | 415 | static void |
415 | collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 416 | collect_stats (void *cls); |
417 | |||
416 | 418 | ||
417 | /** | 419 | /** |
418 | * Connect to DHT services of active peers | 420 | * Connect to DHT services of active peers |
419 | */ | 421 | */ |
420 | static void | 422 | static void |
421 | start_profiling(); | 423 | start_profiling (void); |
424 | |||
422 | 425 | ||
423 | /** | 426 | /** |
424 | * Shutdown task. Cleanup all resources and operations. | 427 | * Shutdown task. Cleanup all resources and operations. |
425 | * | 428 | * |
426 | * @param cls NULL | 429 | * @param cls NULL |
427 | * @param tc scheduler task context | ||
428 | */ | 430 | */ |
429 | static void | 431 | static void |
430 | do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 432 | do_shutdown (void *cls) |
431 | { | 433 | { |
432 | struct ActiveContext *ac; | 434 | struct ActiveContext *ac; |
433 | unsigned int cnt; | 435 | unsigned int cnt; |
@@ -546,10 +548,9 @@ summarize () | |||
546 | * Task to cancel DHT GET. | 548 | * Task to cancel DHT GET. |
547 | * | 549 | * |
548 | * @param cls NULL | 550 | * @param cls NULL |
549 | * @param tc scheduler task context | ||
550 | */ | 551 | */ |
551 | static void | 552 | static void |
552 | cancel_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 553 | cancel_get (void *cls) |
553 | { | 554 | { |
554 | struct ActiveContext *ac = cls; | 555 | struct ActiveContext *ac = cls; |
555 | struct Context *ctx = ac->ctx; | 556 | struct Context *ctx = ac->ctx; |
@@ -637,10 +638,9 @@ get_iter (void *cls, | |||
637 | * Task to do DHT GETs | 638 | * Task to do DHT GETs |
638 | * | 639 | * |
639 | * @param cls the active context | 640 | * @param cls the active context |
640 | * @param tc the scheduler task context | ||
641 | */ | 641 | */ |
642 | static void | 642 | static void |
643 | delayed_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 643 | delayed_get (void *cls) |
644 | { | 644 | { |
645 | struct ActiveContext *ac = cls; | 645 | struct ActiveContext *ac = cls; |
646 | struct ActiveContext *get_ac; | 646 | struct ActiveContext *get_ac; |
@@ -681,14 +681,15 @@ delayed_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
681 | * clear the operation during shutdown. | 681 | * clear the operation during shutdown. |
682 | * | 682 | * |
683 | * @param cls the context | 683 | * @param cls the context |
684 | * @return tc scheduler task context. | ||
685 | */ | 684 | */ |
686 | static void | 685 | static void |
687 | teardown_dht_connection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 686 | teardown_dht_connection (void *cls) |
688 | { | 687 | { |
689 | struct Context *ctx = cls; | 688 | struct Context *ctx = cls; |
690 | struct GNUNET_TESTBED_Operation *op; | 689 | struct GNUNET_TESTBED_Operation *op; |
690 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
691 | 691 | ||
692 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
692 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 693 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
693 | return; | 694 | return; |
694 | GNUNET_assert (NULL != ctx); | 695 | GNUNET_assert (NULL != ctx); |
@@ -725,13 +726,12 @@ put_cont (void *cls, int success) | |||
725 | 726 | ||
726 | 727 | ||
727 | /** | 728 | /** |
728 | * Task to do DHT PUTS | 729 | * Task to do DHT PUTs |
729 | * | 730 | * |
730 | * @param cls the active context | 731 | * @param cls the active context |
731 | * @param tc the scheduler task context | ||
732 | */ | 732 | */ |
733 | static void | 733 | static void |
734 | delayed_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 734 | delayed_put (void *cls) |
735 | { | 735 | { |
736 | struct ActiveContext *ac = cls; | 736 | struct ActiveContext *ac = cls; |
737 | 737 | ||
@@ -1210,15 +1210,18 @@ successor_stats_iterator (void *cls, | |||
1210 | * Task that collects peer and its corresponding successors. | 1210 | * Task that collects peer and its corresponding successors. |
1211 | * | 1211 | * |
1212 | * @param cls Closure (NULL). | 1212 | * @param cls Closure (NULL). |
1213 | * @param tc Task Context. | ||
1214 | */ | 1213 | */ |
1215 | static void | 1214 | static void |
1216 | collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1215 | collect_stats (void *cls) |
1217 | { | 1216 | { |
1217 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1218 | |||
1219 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1218 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) | 1220 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) |
1219 | return; | 1221 | return; |
1220 | 1222 | ||
1221 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Start collecting statistics...\n"); | 1223 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1224 | "Start collecting statistics...\n"); | ||
1222 | GNUNET_assert(NULL != testbed_handles); | 1225 | GNUNET_assert(NULL != testbed_handles); |
1223 | 1226 | ||
1224 | if (0 != max_searches) | 1227 | if (0 != max_searches) |