gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated (6339dc3bd -> ec3fa3cca)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (6339dc3bd -> ec3fa3cca)
Date: Thu, 23 Aug 2018 15:11:31 +0200

This is an automated email from the git hooks/post-receive script.

julius-buenger pushed a change to branch master
in repository gnunet.

    from 6339dc3bd benchmark: count rsa_blind properly
     new 517266896 Refactor code mostly visually to prevent compiler warnings
     new ec3fa3cca Introduce more statistical values (rps service)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/rps/gnunet-service-rps.c           | 80 ++++++++++++++++++++++++++++------
 src/rps/gnunet-service-rps_custommap.c |  2 +-
 src/rps/gnunet-service-rps_custommap.h |  2 +-
 3 files changed, 69 insertions(+), 15 deletions(-)

diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 0c0fe9076..7802b183b 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -465,6 +465,8 @@ get_rand_peer_iterator (void *cls,
                         void *value)
 {
   struct GetRandPeerIteratorCls *iterator_cls = cls;
+  (void) value;
+
   if (0 >= iterator_cls->index)
   {
     iterator_cls->peer = peer;
@@ -526,6 +528,10 @@ add_valid_peer (const struct GNUNET_PeerIdentity *peer)
   }
   (void) GNUNET_CONTAINER_multipeermap_put (valid_peers, peer, NULL,
       GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
+  GNUNET_STATISTICS_set (stats,
+                         "# valid peers",
+                         GNUNET_CONTAINER_multipeermap_size (valid_peers),
+                         GNUNET_NO);
   return ret;
 }
 
@@ -762,12 +768,13 @@ insert_pending_message (const struct GNUNET_PeerIdentity 
*peer,
  * @brief Remove a pending message from the respective DLL
  *
  * @param pending_msg the pending message to remove
- * @param cancel cancel the pending message, too
+ * @param cancel whether to cancel the pending message, too
  */
 static void
 remove_pending_message (struct PendingMessage *pending_msg, int cancel)
 {
   struct PeerContext *peer_ctx;
+  (void) cancel;
 
   peer_ctx = pending_msg->peer_ctx;
   GNUNET_assert (NULL != peer_ctx);
@@ -1026,6 +1033,8 @@ peermap_clear_iterator (void *cls,
                         const struct GNUNET_PeerIdentity *key,
                         void *value)
 {
+  (void) cls;
+  (void) value;
   destroy_peer (get_peer_ctx (key));
   return GNUNET_YES;
 }
@@ -1079,6 +1088,7 @@ store_peer_presistently_iterator (void *cls,
   char peer_string[128];
   int size;
   ssize_t ret;
+  (void) value;
 
   if (NULL == peer)
   {
@@ -1322,6 +1332,7 @@ valid_peer_iterator (void *cls,
                      void *value)
 {
   struct PeersIteratorCls *it_cls = cls;
+  (void) value;
 
   return it_cls->iterator (it_cls->cls,
                            peer);
@@ -1534,6 +1545,7 @@ handle_inbound_channel (void *cls,
   struct PeerContext *peer_ctx;
   struct GNUNET_PeerIdentity *ctx_peer;
   struct ChannelCtx *channel_ctx;
+  (void) cls;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
       "New channel was established to us (Peer %s).\n",
@@ -1661,7 +1673,7 @@ send_message (const struct GNUNET_PeerIdentity *peer,
  */
 static int
 schedule_operation (const struct GNUNET_PeerIdentity *peer,
-                          const PeerOp peer_op)
+                    const PeerOp peer_op)
 {
   struct PeerPendingOp pending_op;
   struct PeerContext *peer_ctx;
@@ -2137,6 +2149,7 @@ static int
 insert_in_view (const struct GNUNET_PeerIdentity *peer)
 {
   int online;
+  int ret;
 
   online = check_peer_flag (peer, Peers_ONLINE);
   if ( (GNUNET_NO == online) ||
@@ -2148,7 +2161,9 @@ insert_in_view (const struct GNUNET_PeerIdentity *peer)
   }
   /* Open channel towards peer to keep connection open */
   indicate_sending_intention (peer);
-  return View_put (peer);
+  ret = View_put (peer);
+  GNUNET_STATISTICS_set (stats, "view size", View_size(), GNUNET_NO);
+  return ret;
 }
 
 /**
@@ -2162,10 +2177,11 @@ clients_notify_view_update (void);
  */
 static void
 hist_update (void *cls,
-            struct GNUNET_PeerIdentity *ids,
-            uint32_t num_peers)
+             struct GNUNET_PeerIdentity *ids,
+             uint32_t num_peers)
 {
   unsigned int i;
+  (void) cls;
 
   for (i = 0; i < num_peers; i++)
   {
@@ -2355,8 +2371,9 @@ send_pull_reply (const struct GNUNET_PeerIdentity 
*peer_id,
  */
 static void
 insert_in_pull_map (void *cls,
-                   const struct GNUNET_PeerIdentity *peer)
+                    const struct GNUNET_PeerIdentity *peer)
 {
+  (void) cls;
   CustomPeerMap_put (pull_map, peer);
 }
 
@@ -2369,8 +2386,9 @@ insert_in_pull_map (void *cls,
  */
 static void
 insert_in_view_op (void *cls,
-               const struct GNUNET_PeerIdentity *peer)
+                   const struct GNUNET_PeerIdentity *peer)
 {
+  (void) cls;
   (void) insert_in_view (peer);
 }
 
@@ -2381,8 +2399,9 @@ insert_in_view_op (void *cls,
  */
 static void
 insert_in_sampler (void *cls,
-                  const struct GNUNET_PeerIdentity *peer)
+                   const struct GNUNET_PeerIdentity *peer)
 {
+  (void) cls;
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Updating samplers with peer %s from insert_in_sampler()\n",
        GNUNET_i2s (peer));
@@ -2431,6 +2450,10 @@ got_peer (const struct GNUNET_PeerIdentity *peer)
     schedule_operation (peer, insert_in_sampler);
     schedule_operation (peer, insert_in_view_op);
   }
+  GNUNET_STATISTICS_update (stats,
+                            "# learnd peers",
+                            1,
+                            GNUNET_NO);
 }
 
 /**
@@ -2539,6 +2562,8 @@ cleanup_destroyed_channel (void *cls,
 {
   struct ChannelCtx *channel_ctx = cls;
   struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
+  (void) cls;
+  (void) channel;
 
   channel_ctx->channel = NULL;
   remove_channel_ctx (channel_ctx);
@@ -2597,11 +2622,13 @@ destroy_cli_ctx (struct ClientContext *cli_ctx)
  */
 static void
 nse_callback (void *cls,
-             struct GNUNET_TIME_Absolute timestamp,
+              struct GNUNET_TIME_Absolute timestamp,
               double logestimate, double std_dev)
 {
   double estimate;
   //double scale; // TODO this might go gloabal/config
+  (void) cls;
+  (void) timestamp;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Received a ns estimate - logest: %f, std_dev: %f (old_size: %u)\n",
@@ -2623,6 +2650,7 @@ nse_callback (void *cls,
     //sampler_size_est_need = view_size_est_min;
     view_size_est_need = view_size_est_min;
   }
+  GNUNET_STATISTICS_set (stats, "view size aim", view_size_est_need, 
GNUNET_NO);
 
   /* If the NSE has changed adapt the lists accordingly */
   resize_wrapper (prot_sampler, sampler_size_est_need);
@@ -2923,6 +2951,7 @@ handle_client_view_request (void *cls,
   GNUNET_SERVICE_client_continue (cli_ctx->client);
 }
 
+
 /**
  * Handle a CHECK_LIVE message from another peer.
  *
@@ -2938,6 +2967,8 @@ handle_peer_check (void *cls,
 {
   const struct ChannelCtx *channel_ctx = cls;
   const struct GNUNET_PeerIdentity *peer = &channel_ctx->peer_ctx->peer_id;
+  (void) msg;
+
   LOG (GNUNET_ERROR_TYPE_DEBUG,
       "Received CHECK_LIVE (%s)\n", GNUNET_i2s (peer));
 
@@ -2959,6 +2990,7 @@ handle_peer_push (void *cls,
 {
   const struct ChannelCtx *channel_ctx = cls;
   const struct GNUNET_PeerIdentity *peer = &channel_ctx->peer_ctx->peer_id;
+  (void) msg;
 
   // (check the proof of work (?))
 
@@ -3022,6 +3054,7 @@ handle_peer_pull_request (void *cls,
   const struct ChannelCtx *channel_ctx = cls;
   const struct GNUNET_PeerIdentity *peer = &channel_ctx->peer_ctx->peer_id;
   const struct GNUNET_PeerIdentity *view_array;
+  (void) msg;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Received PULL REQUEST (%s)\n", GNUNET_i2s 
(peer));
   GNUNET_STATISTICS_update(stats, "# pull request message received", 1, 
GNUNET_NO);
@@ -3429,6 +3462,7 @@ do_mal_round (void *cls)
   uint32_t i;
   struct GNUNET_TIME_Relative time_next_round;
   struct AttackedPeer *tmp_att_peer;
+  (void) cls;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Going to execute next round maliciously type %" PRIu32 ".\n",
@@ -3554,7 +3588,7 @@ do_mal_round (void *cls)
 static void
 do_round (void *cls)
 {
-  uint32_t i;
+  unsigned int i;
   const struct GNUNET_PeerIdentity *view_array;
   unsigned int *permut;
   unsigned int a_peers; /* Number of peers we send pushes to */
@@ -3563,6 +3597,7 @@ do_round (void *cls)
   uint32_t second_border;
   struct GNUNET_PeerIdentity peer;
   struct GNUNET_PeerIdentity *update_peer;
+  (void) cls;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Going to execute next round.\n");
@@ -3786,6 +3821,11 @@ do_round (void *cls)
   CustomPeerMap_clear (push_map);
   CustomPeerMap_clear (pull_map);
 
+  GNUNET_STATISTICS_set (stats,
+                         "view size",
+                         View_size(),
+                         GNUNET_NO);
+
   struct GNUNET_TIME_Relative time_next_round;
 
   time_next_round = compute_rand_delay (round_interval, 2);
@@ -3811,6 +3851,11 @@ init_peer_cb (void *cls,
               unsigned int best_path) // "How long is the best path?
                                       // (0 = unknown, 1 = ourselves, 2 = 
neighbor)"
 {
+  (void) cls;
+  (void) tunnel;
+  (void) n_paths;
+  (void) best_path;
+
   if (NULL != peer)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -3835,6 +3880,8 @@ static int
 valid_peers_iterator (void *cls,
                       const struct GNUNET_PeerIdentity *peer)
 {
+  (void) cls;
+
   if (NULL != peer)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -3860,6 +3907,10 @@ process_peerinfo_peers (void *cls,
                         const struct GNUNET_HELLO_Message *hello,
                         const char *err_msg)
 {
+  (void) cls;
+  (void) hello;
+  (void) err_msg;
+
   if (NULL != peer)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -3880,6 +3931,7 @@ shutdown_task (void *cls)
 {
   struct ClientContext *client_ctx;
   struct ReplyCls *reply_cls;
+  (void) cls;
 
   in_shutdown = GNUNET_YES;
 
@@ -3903,8 +3955,8 @@ shutdown_task (void *cls)
       GNUNET_free (reply_cls);
     }
     GNUNET_CONTAINER_DLL_remove (cli_ctx_head,
-                                cli_ctx_tail,
-                                client_ctx);
+                                 cli_ctx_tail,
+                                 client_ctx);
     GNUNET_free (client_ctx);
   }
   GNUNET_PEERINFO_notify_cancel (peerinfo_notify_handle);
@@ -3974,13 +4026,14 @@ client_connect_cb (void *cls,
                    struct GNUNET_MQ_Handle *mq)
 {
   struct ClientContext *cli_ctx;
+  (void) cls;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Client connected\n");
   if (NULL == client)
     return client; /* Server was destroyed before a client connected. Shutting 
down */
   cli_ctx = GNUNET_new (struct ClientContext);
-  cli_ctx->mq = GNUNET_SERVICE_client_get_mq (client);
+  cli_ctx->mq = mq;
   cli_ctx->view_updates_left = -1;
   cli_ctx->client = client;
   GNUNET_CONTAINER_DLL_insert (cli_ctx_head,
@@ -4089,6 +4142,7 @@ run (void *cls,
 
 
   View_create (view_size_est_min);
+  GNUNET_STATISTICS_set (stats, "view size aim", view_size_est_min, GNUNET_NO);
 
   /* file_name_view_log */
   file_name_view_log = store_prefix_file_name (&own_identity, "view");
diff --git a/src/rps/gnunet-service-rps_custommap.c 
b/src/rps/gnunet-service-rps_custommap.c
index 3513ff8da..c0cb6e650 100644
--- a/src/rps/gnunet-service-rps_custommap.c
+++ b/src/rps/gnunet-service-rps_custommap.c
@@ -91,7 +91,7 @@ CustomPeerMap_create (unsigned int len)
  *
  * @return size of the map
  */
-int
+unsigned int
 CustomPeerMap_size (const struct CustomPeerMap *c_peer_map)
 {
   GNUNET_assert (GNUNET_CONTAINER_multihashmap32_size (c_peer_map->hash_map) ==
diff --git a/src/rps/gnunet-service-rps_custommap.h 
b/src/rps/gnunet-service-rps_custommap.h
index b42ae9efa..376213728 100644
--- a/src/rps/gnunet-service-rps_custommap.h
+++ b/src/rps/gnunet-service-rps_custommap.h
@@ -68,7 +68,7 @@ CustomPeerMap_create (unsigned int len);
  *
  * @return size of the map
  */
-int
+unsigned int
 CustomPeerMap_size (const struct CustomPeerMap *c_peer_map);
 
 /**

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]