gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] 04/04: RPS sampler: Stop logging to file


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 04/04: RPS sampler: Stop logging to file
Date: Thu, 13 Dec 2018 15:54:33 +0100

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

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

commit 4280ed184029acdac70f4c85e4bc3a2d6cf0aeb0
Author: Julius Bünger <address@hidden>
AuthorDate: Thu Dec 13 15:51:36 2018 +0100

    RPS sampler: Stop logging to file
---
 src/rps/gnunet-service-rps_sampler.c      |  9 --------
 src/rps/gnunet-service-rps_sampler_elem.c | 36 -------------------------------
 src/rps/rps-sampler_client.c              |  9 --------
 src/rps/rps-sampler_common.c              | 25 ---------------------
 src/rps/rps-sampler_common.h              |  6 ------
 5 files changed, 85 deletions(-)

diff --git a/src/rps/gnunet-service-rps_sampler.c 
b/src/rps/gnunet-service-rps_sampler.c
index dcfef19c6..d3abfa67f 100644
--- a/src/rps/gnunet-service-rps_sampler.c
+++ b/src/rps/gnunet-service-rps_sampler.c
@@ -202,15 +202,6 @@ RPS_sampler_init (size_t init_size,
 
   sampler = GNUNET_new (struct RPS_Sampler);
 
-  #ifdef TO_FILE
-  sampler->file_name = create_file ("sampler-");
-  GNUNET_assert (NULL != sampler->file_name);
-
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Initialised sampler %s\n",
-       sampler->file_name);
-  #endif /* TO_FILE */
-
   sampler->max_round_interval = max_round_interval;
   sampler->get_peers = sampler_get_rand_peer;
   //sampler->sampler_elements = GNUNET_new_array(init_size, struct 
GNUNET_PeerIdentity);
diff --git a/src/rps/gnunet-service-rps_sampler_elem.c 
b/src/rps/gnunet-service-rps_sampler_elem.c
index a1a46b2d7..f0c112ac7 100644
--- a/src/rps/gnunet-service-rps_sampler_elem.c
+++ b/src/rps/gnunet-service-rps_sampler_elem.c
@@ -54,15 +54,6 @@ RPS_sampler_elem_reinit (struct RPS_SamplerElement 
*sampler_elem)
                              &(sampler_elem->auth_key.key),
                              GNUNET_CRYPTO_HASH_LENGTH);
 
-  #ifdef TO_FILE
-  /* Create a file(-name) to store internals to */
-  char *name_buf;
-  name_buf = auth_key_to_string (sampler_elem->auth_key);
-
-  sampler_elem->file_name = create_file (name_buf);
-  GNUNET_free (name_buf);
-  #endif /* TO_FILE */
-
   sampler_elem->last_client_request = GNUNET_TIME_UNIT_FOREVER_ABS;
 
   sampler_elem->birth = GNUNET_TIME_absolute_get ();
@@ -100,12 +91,6 @@ RPS_sampler_elem_create (void)
 void
 RPS_sampler_elem_destroy (struct RPS_SamplerElement *sampler_elem)
 {
-  #ifdef TO_FILE
-  if (NULL != sampler_elem->file_name)
-  {
-    GNUNET_free (sampler_elem->file_name);
-  }
-  #endif /* TO_FILE */
   GNUNET_free (sampler_elem);
 }
 
@@ -124,12 +109,6 @@ RPS_sampler_elem_next (struct RPS_SamplerElement 
*sampler_elem,
 
   sampler_elem->num_peers++;
 
-  #ifdef TO_FILE
-  to_file (sampler_elem->file_name,
-           "Got id %s",
-           GNUNET_i2s_full (new_ID));
-  #endif /* TO_FILE */
-
   if (0 == GNUNET_CRYPTO_cmp_peer_identity (new_ID, &(sampler_elem->peer_id)))
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, "Have already PeerID %s\n",
@@ -168,12 +147,6 @@ RPS_sampler_elem_next (struct RPS_SamplerElement 
*sampler_elem,
     }
   }
   sampler_elem->is_empty = NOT_EMPTY;
-
-  #ifdef TO_FILE
-  to_file (sampler_elem->file_name,
-           "Now holding %s",
-           GNUNET_i2s_full (&sampler_elem->peer_id));
-  #endif /* TO_FILE */
 }
 
 /**
@@ -187,15 +160,6 @@ RPS_sampler_elem_set (struct RPS_SamplerElement 
*sampler_elem,
                       struct GNUNET_CRYPTO_AuthKey auth_key)
 {
   sampler_elem->auth_key = auth_key;
-
-  #ifdef TO_FILE
-  /* Create a file(-name) to store internals to */
-  char *name_buf;
-  name_buf = auth_key_to_string (sampler_elem->auth_key);
-
-  sampler_elem->file_name = create_file (name_buf);
-  GNUNET_free (name_buf);
-  #endif /* TO_FILE */
 }
 
 /* end of gnunet-service-rps.c */
diff --git a/src/rps/rps-sampler_client.c b/src/rps/rps-sampler_client.c
index fea824cf3..7b6094b0c 100644
--- a/src/rps/rps-sampler_client.c
+++ b/src/rps/rps-sampler_client.c
@@ -210,15 +210,6 @@ RPS_sampler_mod_init (size_t init_size,
 
   //GNUNET_assert (init_size == sampler->sampler_size);
 
-#ifdef TO_FILE
-  sampler->file_name = create_file ("sampler-");
-
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Initialised modified sampler %s\n",
-       sampler->file_name);
-  to_file (sampler->file_name,
-           "This is a modified sampler");
-#endif /* TO_FILE */
   RPS_sampler_resize (sampler, init_size);
 
   return sampler;
diff --git a/src/rps/rps-sampler_common.c b/src/rps/rps-sampler_common.c
index 5dbb5315a..60d2d5ed5 100644
--- a/src/rps/rps-sampler_common.c
+++ b/src/rps/rps-sampler_common.c
@@ -199,10 +199,6 @@ notify_update (struct RPS_Sampler *sampler)
 RPS_sampler_update (struct RPS_Sampler *sampler,
                     const struct GNUNET_PeerIdentity *id)
 {
-  to_file (sampler->file_name,
-           "Got %s",
-           GNUNET_i2s_full (id));
-
   for (uint32_t i = 0; i < sampler->sampler_size; i++)
   {
     RPS_sampler_elem_next (sampler->sampler_elements[i],
@@ -232,8 +228,6 @@ RPS_sampler_reinitialise_by_value (struct RPS_Sampler 
*sampler,
           &(sampler->sampler_elements[i]->peer_id)) )
     {
       LOG (GNUNET_ERROR_TYPE_DEBUG, "Reinitialising sampler\n");
-      to_file (sampler->sampler_elements[i]->file_name,
-               "--- non-active");
       RPS_sampler_elem_reinit (sampler->sampler_elements[i]);
     }
   }
@@ -290,17 +284,8 @@ sampler_resize (struct RPS_Sampler *sampler, unsigned int 
new_size)
          old_size,
          new_size);
 
-    to_file (sampler->file_name,
-         "Shrinking sampler %d -> %d",
-         old_size,
-         new_size);
-
     for (i = new_size ; i < old_size ; i++)
     {
-      to_file (sampler->file_name,
-               "-%" PRIu32 ": %s",
-               i,
-               sampler->sampler_elements[i]->file_name);
       RPS_sampler_elem_destroy (sampler->sampler_elements[i]);
     }
 
@@ -319,11 +304,6 @@ sampler_resize (struct RPS_Sampler *sampler, unsigned int 
new_size)
          old_size,
          new_size);
 
-    to_file (sampler->file_name,
-         "Growing sampler %d -> %d",
-         old_size,
-         new_size);
-
     GNUNET_array_grow (sampler->sampler_elements,
         sampler->sampler_size,
         new_size);
@@ -331,11 +311,6 @@ sampler_resize (struct RPS_Sampler *sampler, unsigned int 
new_size)
     for (i = old_size ; i < new_size ; i++)
     { /* Add new sampler elements */
       sampler->sampler_elements[i] = RPS_sampler_elem_create ();
-
-      to_file (sampler->file_name,
-               "+%" PRIu32 ": %s",
-               i,
-               sampler->sampler_elements[i]->file_name);
     }
   }
   else
diff --git a/src/rps/rps-sampler_common.h b/src/rps/rps-sampler_common.h
index 68f5865a9..a9a079aff 100644
--- a/src/rps/rps-sampler_common.h
+++ b/src/rps/rps-sampler_common.h
@@ -158,12 +158,6 @@ struct RPS_Sampler
 
   struct SamplerNotifyUpdateCTX *notify_ctx_head;
   struct SamplerNotifyUpdateCTX *notify_ctx_tail;
-  #ifdef TO_FILE
-  /**
-   * File name to log to
-   */
-  char *file_name;
-  #endif /* TO_FILE */
 };
 
 

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



reply via email to

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