diff options
author | Julius Bünger <buenger@mytum.de> | 2015-03-28 15:28:50 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2015-03-28 15:28:50 +0000 |
commit | 3a30016f3eb61c60156d7f53237e3690662c2dcc (patch) | |
tree | 7c27b4f312cfd3fef1781befd0ef655c71345a91 /src/rps | |
parent | d50372eb9d963ac9ff628b74fadada5281fd1c00 (diff) | |
download | gnunet-3a30016f3eb61c60156d7f53237e3690662c2dcc.tar.gz gnunet-3a30016f3eb61c60156d7f53237e3690662c2dcc.zip |
-logging
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 25 | ||||
-rw-r--r-- | src/rps/gnunet-service-rps_sampler.c | 8 |
2 files changed, 19 insertions, 14 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 7f91f4203..b078dc405 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -1516,8 +1516,6 @@ handle_peer_pull_reply (void *cls, | |||
1516 | void **channel_ctx, | 1516 | void **channel_ctx, |
1517 | const struct GNUNET_MessageHeader *msg) | 1517 | const struct GNUNET_MessageHeader *msg) |
1518 | { | 1518 | { |
1519 | LOG (GNUNET_ERROR_TYPE_DEBUG, "PULL REPLY received\n"); | ||
1520 | |||
1521 | struct GNUNET_RPS_P2P_PullReplyMessage *in_msg; | 1519 | struct GNUNET_RPS_P2P_PullReplyMessage *in_msg; |
1522 | struct GNUNET_PeerIdentity *peers; | 1520 | struct GNUNET_PeerIdentity *peers; |
1523 | struct PeerContext *peer_ctx; | 1521 | struct PeerContext *peer_ctx; |
@@ -1571,8 +1569,16 @@ handle_peer_pull_reply (void *cls, | |||
1571 | /* Do actual logic */ | 1569 | /* Do actual logic */ |
1572 | peers = (struct GNUNET_PeerIdentity *) &msg[1]; | 1570 | peers = (struct GNUNET_PeerIdentity *) &msg[1]; |
1573 | 1571 | ||
1572 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1573 | "PULL REPLY received, got following peers:\n"); | ||
1574 | |||
1574 | for (i = 0 ; i < ntohl (in_msg->num_peers) ; i++) | 1575 | for (i = 0 ; i < ntohl (in_msg->num_peers) ; i++) |
1575 | { | 1576 | { |
1577 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1578 | "%u. %s\n", | ||
1579 | i, | ||
1580 | GNUNET_i2s (&peers[i])); | ||
1581 | |||
1576 | #ifdef ENABLE_MALICIOUS | 1582 | #ifdef ENABLE_MALICIOUS |
1577 | if (1 == mal_type) | 1583 | if (1 == mal_type) |
1578 | { | 1584 | { |
@@ -2041,6 +2047,13 @@ do_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2041 | } | 2047 | } |
2042 | // TODO independent of that also get some peers from CADET_get_peers()? | 2048 | // TODO independent of that also get some peers from CADET_get_peers()? |
2043 | 2049 | ||
2050 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2051 | "Received %u pushes and %u pulls last round (alpha (%.2f) * gossip_list_size (%u) = %.2f)\n", | ||
2052 | push_list_size, | ||
2053 | pull_list_size, | ||
2054 | alpha, | ||
2055 | gossip_list_size, | ||
2056 | alpha * gossip_list_size); | ||
2044 | 2057 | ||
2045 | /* Update samplers */ | 2058 | /* Update samplers */ |
2046 | for ( i = 0 ; i < push_list_size ; i++ ) | 2059 | for ( i = 0 ; i < push_list_size ; i++ ) |
@@ -2370,9 +2383,9 @@ rps_start (struct GNUNET_SERVER_Handle *server) | |||
2370 | 2383 | ||
2371 | GNUNET_SERVER_add_handlers (server, handlers); | 2384 | GNUNET_SERVER_add_handlers (server, handlers); |
2372 | GNUNET_SERVER_disconnect_notify (server, | 2385 | GNUNET_SERVER_disconnect_notify (server, |
2373 | &handle_client_disconnect, | 2386 | &handle_client_disconnect, |
2374 | NULL); | 2387 | NULL); |
2375 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Ready to receive requests from clients\n"); | 2388 | LOG (GNUNET_ERROR_TYPE_INFO, "Ready to receive requests from clients\n"); |
2376 | 2389 | ||
2377 | 2390 | ||
2378 | do_round_task = GNUNET_SCHEDULER_add_now (&do_round, NULL); | 2391 | do_round_task = GNUNET_SCHEDULER_add_now (&do_round, NULL); |
@@ -2408,7 +2421,7 @@ run (void *cls, | |||
2408 | "STARTING SERVICE (rps) for peer [%s]\n", | 2421 | "STARTING SERVICE (rps) for peer [%s]\n", |
2409 | GNUNET_i2s (&own_identity)); | 2422 | GNUNET_i2s (&own_identity)); |
2410 | #ifdef ENABLE_MALICIOUS | 2423 | #ifdef ENABLE_MALICIOUS |
2411 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2424 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2412 | "Malicious execution compiled in.\n"); | 2425 | "Malicious execution compiled in.\n"); |
2413 | #endif /* ENABLE_MALICIOUS */ | 2426 | #endif /* ENABLE_MALICIOUS */ |
2414 | 2427 | ||
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c index ba6d6cbb1..f1fa53e01 100644 --- a/src/rps/gnunet-service-rps_sampler.c +++ b/src/rps/gnunet-service-rps_sampler.c | |||
@@ -314,7 +314,6 @@ RPS_sampler_elem_create (void) | |||
314 | s = GNUNET_new (struct RPS_SamplerElement); | 314 | s = GNUNET_new (struct RPS_SamplerElement); |
315 | 315 | ||
316 | RPS_sampler_elem_reinit (s); | 316 | RPS_sampler_elem_reinit (s); |
317 | LOG (GNUNET_ERROR_TYPE_DEBUG, "initialised with empty PeerID\n"); | ||
318 | 317 | ||
319 | return s; | 318 | return s; |
320 | } | 319 | } |
@@ -424,16 +423,10 @@ sampler_resize (struct RPS_Sampler *sampler, unsigned int new_size) | |||
424 | { /* Growing */ | 423 | { /* Growing */ |
425 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Growing sampler %d -> %d\n", old_size, new_size); | 424 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Growing sampler %d -> %d\n", old_size, new_size); |
426 | GNUNET_array_grow (sampler->sampler_elements, sampler->sampler_size, new_size); | 425 | GNUNET_array_grow (sampler->sampler_elements, sampler->sampler_size, new_size); |
427 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
428 | "sampler->sampler_elements now points to %p\n", | ||
429 | sampler->sampler_elements); | ||
430 | 426 | ||
431 | for ( i = old_size ; i < new_size ; i++ ) | 427 | for ( i = old_size ; i < new_size ; i++ ) |
432 | { /* Add new sampler elements */ | 428 | { /* Add new sampler elements */ |
433 | sampler->sampler_elements[i] = RPS_sampler_elem_create (); | 429 | sampler->sampler_elements[i] = RPS_sampler_elem_create (); |
434 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
435 | "Added %" PRIX32 ". sampler, now pointing to %p, contains %s\n", | ||
436 | i, &sampler->sampler_elements[i], GNUNET_i2s (&sampler->sampler_elements[i]->peer_id)); | ||
437 | } | 430 | } |
438 | } | 431 | } |
439 | else | 432 | else |
@@ -443,7 +436,6 @@ sampler_resize (struct RPS_Sampler *sampler, unsigned int new_size) | |||
443 | } | 436 | } |
444 | 437 | ||
445 | GNUNET_assert (sampler->sampler_size == new_size); | 438 | GNUNET_assert (sampler->sampler_size == new_size); |
446 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Finished growing/shrinking.\n"); // remove | ||
447 | } | 439 | } |
448 | 440 | ||
449 | 441 | ||