aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet_dht_profiler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet_dht_profiler.c')
-rw-r--r--src/dht/gnunet_dht_profiler.c37
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 */
407static unsigned int tries; 407static 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 */
414static void 415static void
415collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 416collect_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 */
420static void 422static void
421start_profiling(); 423start_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 */
429static void 431static void
430do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 432do_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 */
551static void 552static void
552cancel_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 553cancel_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 */
642static void 642static void
643delayed_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 643delayed_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 */
686static void 685static void
687teardown_dht_connection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 686teardown_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 */
733static void 733static void
734delayed_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 734delayed_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 */
1215static void 1214static void
1216collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1215collect_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)