diff options
author | Julius Bünger <buenger@mytum.de> | 2018-12-13 15:51:36 +0100 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2018-12-13 15:52:54 +0100 |
commit | 4280ed184029acdac70f4c85e4bc3a2d6cf0aeb0 (patch) | |
tree | d77180d3d4028f08b5fb14bf2643895af0b03f70 /src/rps | |
parent | 37f806bedb12e20a6ccdd87df7fa28d4b4ad041e (diff) | |
download | gnunet-4280ed184029acdac70f4c85e4bc3a2d6cf0aeb0.tar.gz gnunet-4280ed184029acdac70f4c85e4bc3a2d6cf0aeb0.zip |
RPS sampler: Stop logging to file
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps_sampler.c | 9 | ||||
-rw-r--r-- | src/rps/gnunet-service-rps_sampler_elem.c | 36 | ||||
-rw-r--r-- | src/rps/rps-sampler_client.c | 9 | ||||
-rw-r--r-- | src/rps/rps-sampler_common.c | 25 | ||||
-rw-r--r-- | src/rps/rps-sampler_common.h | 6 |
5 files changed, 0 insertions, 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, | |||
202 | 202 | ||
203 | sampler = GNUNET_new (struct RPS_Sampler); | 203 | sampler = GNUNET_new (struct RPS_Sampler); |
204 | 204 | ||
205 | #ifdef TO_FILE | ||
206 | sampler->file_name = create_file ("sampler-"); | ||
207 | GNUNET_assert (NULL != sampler->file_name); | ||
208 | |||
209 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
210 | "Initialised sampler %s\n", | ||
211 | sampler->file_name); | ||
212 | #endif /* TO_FILE */ | ||
213 | |||
214 | sampler->max_round_interval = max_round_interval; | 205 | sampler->max_round_interval = max_round_interval; |
215 | sampler->get_peers = sampler_get_rand_peer; | 206 | sampler->get_peers = sampler_get_rand_peer; |
216 | //sampler->sampler_elements = GNUNET_new_array(init_size, struct GNUNET_PeerIdentity); | 207 | //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) | |||
54 | &(sampler_elem->auth_key.key), | 54 | &(sampler_elem->auth_key.key), |
55 | GNUNET_CRYPTO_HASH_LENGTH); | 55 | GNUNET_CRYPTO_HASH_LENGTH); |
56 | 56 | ||
57 | #ifdef TO_FILE | ||
58 | /* Create a file(-name) to store internals to */ | ||
59 | char *name_buf; | ||
60 | name_buf = auth_key_to_string (sampler_elem->auth_key); | ||
61 | |||
62 | sampler_elem->file_name = create_file (name_buf); | ||
63 | GNUNET_free (name_buf); | ||
64 | #endif /* TO_FILE */ | ||
65 | |||
66 | sampler_elem->last_client_request = GNUNET_TIME_UNIT_FOREVER_ABS; | 57 | sampler_elem->last_client_request = GNUNET_TIME_UNIT_FOREVER_ABS; |
67 | 58 | ||
68 | sampler_elem->birth = GNUNET_TIME_absolute_get (); | 59 | sampler_elem->birth = GNUNET_TIME_absolute_get (); |
@@ -100,12 +91,6 @@ RPS_sampler_elem_create (void) | |||
100 | void | 91 | void |
101 | RPS_sampler_elem_destroy (struct RPS_SamplerElement *sampler_elem) | 92 | RPS_sampler_elem_destroy (struct RPS_SamplerElement *sampler_elem) |
102 | { | 93 | { |
103 | #ifdef TO_FILE | ||
104 | if (NULL != sampler_elem->file_name) | ||
105 | { | ||
106 | GNUNET_free (sampler_elem->file_name); | ||
107 | } | ||
108 | #endif /* TO_FILE */ | ||
109 | GNUNET_free (sampler_elem); | 94 | GNUNET_free (sampler_elem); |
110 | } | 95 | } |
111 | 96 | ||
@@ -124,12 +109,6 @@ RPS_sampler_elem_next (struct RPS_SamplerElement *sampler_elem, | |||
124 | 109 | ||
125 | sampler_elem->num_peers++; | 110 | sampler_elem->num_peers++; |
126 | 111 | ||
127 | #ifdef TO_FILE | ||
128 | to_file (sampler_elem->file_name, | ||
129 | "Got id %s", | ||
130 | GNUNET_i2s_full (new_ID)); | ||
131 | #endif /* TO_FILE */ | ||
132 | |||
133 | if (0 == GNUNET_CRYPTO_cmp_peer_identity (new_ID, &(sampler_elem->peer_id))) | 112 | if (0 == GNUNET_CRYPTO_cmp_peer_identity (new_ID, &(sampler_elem->peer_id))) |
134 | { | 113 | { |
135 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Have already PeerID %s\n", | 114 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Have already PeerID %s\n", |
@@ -168,12 +147,6 @@ RPS_sampler_elem_next (struct RPS_SamplerElement *sampler_elem, | |||
168 | } | 147 | } |
169 | } | 148 | } |
170 | sampler_elem->is_empty = NOT_EMPTY; | 149 | sampler_elem->is_empty = NOT_EMPTY; |
171 | |||
172 | #ifdef TO_FILE | ||
173 | to_file (sampler_elem->file_name, | ||
174 | "Now holding %s", | ||
175 | GNUNET_i2s_full (&sampler_elem->peer_id)); | ||
176 | #endif /* TO_FILE */ | ||
177 | } | 150 | } |
178 | 151 | ||
179 | /** | 152 | /** |
@@ -187,15 +160,6 @@ RPS_sampler_elem_set (struct RPS_SamplerElement *sampler_elem, | |||
187 | struct GNUNET_CRYPTO_AuthKey auth_key) | 160 | struct GNUNET_CRYPTO_AuthKey auth_key) |
188 | { | 161 | { |
189 | sampler_elem->auth_key = auth_key; | 162 | sampler_elem->auth_key = auth_key; |
190 | |||
191 | #ifdef TO_FILE | ||
192 | /* Create a file(-name) to store internals to */ | ||
193 | char *name_buf; | ||
194 | name_buf = auth_key_to_string (sampler_elem->auth_key); | ||
195 | |||
196 | sampler_elem->file_name = create_file (name_buf); | ||
197 | GNUNET_free (name_buf); | ||
198 | #endif /* TO_FILE */ | ||
199 | } | 163 | } |
200 | 164 | ||
201 | /* end of gnunet-service-rps.c */ | 165 | /* 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, | |||
210 | 210 | ||
211 | //GNUNET_assert (init_size == sampler->sampler_size); | 211 | //GNUNET_assert (init_size == sampler->sampler_size); |
212 | 212 | ||
213 | #ifdef TO_FILE | ||
214 | sampler->file_name = create_file ("sampler-"); | ||
215 | |||
216 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
217 | "Initialised modified sampler %s\n", | ||
218 | sampler->file_name); | ||
219 | to_file (sampler->file_name, | ||
220 | "This is a modified sampler"); | ||
221 | #endif /* TO_FILE */ | ||
222 | RPS_sampler_resize (sampler, init_size); | 213 | RPS_sampler_resize (sampler, init_size); |
223 | 214 | ||
224 | return sampler; | 215 | 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) | |||
199 | RPS_sampler_update (struct RPS_Sampler *sampler, | 199 | RPS_sampler_update (struct RPS_Sampler *sampler, |
200 | const struct GNUNET_PeerIdentity *id) | 200 | const struct GNUNET_PeerIdentity *id) |
201 | { | 201 | { |
202 | to_file (sampler->file_name, | ||
203 | "Got %s", | ||
204 | GNUNET_i2s_full (id)); | ||
205 | |||
206 | for (uint32_t i = 0; i < sampler->sampler_size; i++) | 202 | for (uint32_t i = 0; i < sampler->sampler_size; i++) |
207 | { | 203 | { |
208 | RPS_sampler_elem_next (sampler->sampler_elements[i], | 204 | RPS_sampler_elem_next (sampler->sampler_elements[i], |
@@ -232,8 +228,6 @@ RPS_sampler_reinitialise_by_value (struct RPS_Sampler *sampler, | |||
232 | &(sampler->sampler_elements[i]->peer_id)) ) | 228 | &(sampler->sampler_elements[i]->peer_id)) ) |
233 | { | 229 | { |
234 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Reinitialising sampler\n"); | 230 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Reinitialising sampler\n"); |
235 | to_file (sampler->sampler_elements[i]->file_name, | ||
236 | "--- non-active"); | ||
237 | RPS_sampler_elem_reinit (sampler->sampler_elements[i]); | 231 | RPS_sampler_elem_reinit (sampler->sampler_elements[i]); |
238 | } | 232 | } |
239 | } | 233 | } |
@@ -290,17 +284,8 @@ sampler_resize (struct RPS_Sampler *sampler, unsigned int new_size) | |||
290 | old_size, | 284 | old_size, |
291 | new_size); | 285 | new_size); |
292 | 286 | ||
293 | to_file (sampler->file_name, | ||
294 | "Shrinking sampler %d -> %d", | ||
295 | old_size, | ||
296 | new_size); | ||
297 | |||
298 | for (i = new_size ; i < old_size ; i++) | 287 | for (i = new_size ; i < old_size ; i++) |
299 | { | 288 | { |
300 | to_file (sampler->file_name, | ||
301 | "-%" PRIu32 ": %s", | ||
302 | i, | ||
303 | sampler->sampler_elements[i]->file_name); | ||
304 | RPS_sampler_elem_destroy (sampler->sampler_elements[i]); | 289 | RPS_sampler_elem_destroy (sampler->sampler_elements[i]); |
305 | } | 290 | } |
306 | 291 | ||
@@ -319,11 +304,6 @@ sampler_resize (struct RPS_Sampler *sampler, unsigned int new_size) | |||
319 | old_size, | 304 | old_size, |
320 | new_size); | 305 | new_size); |
321 | 306 | ||
322 | to_file (sampler->file_name, | ||
323 | "Growing sampler %d -> %d", | ||
324 | old_size, | ||
325 | new_size); | ||
326 | |||
327 | GNUNET_array_grow (sampler->sampler_elements, | 307 | GNUNET_array_grow (sampler->sampler_elements, |
328 | sampler->sampler_size, | 308 | sampler->sampler_size, |
329 | new_size); | 309 | new_size); |
@@ -331,11 +311,6 @@ sampler_resize (struct RPS_Sampler *sampler, unsigned int new_size) | |||
331 | for (i = old_size ; i < new_size ; i++) | 311 | for (i = old_size ; i < new_size ; i++) |
332 | { /* Add new sampler elements */ | 312 | { /* Add new sampler elements */ |
333 | sampler->sampler_elements[i] = RPS_sampler_elem_create (); | 313 | sampler->sampler_elements[i] = RPS_sampler_elem_create (); |
334 | |||
335 | to_file (sampler->file_name, | ||
336 | "+%" PRIu32 ": %s", | ||
337 | i, | ||
338 | sampler->sampler_elements[i]->file_name); | ||
339 | } | 314 | } |
340 | } | 315 | } |
341 | else | 316 | 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 | |||
158 | 158 | ||
159 | struct SamplerNotifyUpdateCTX *notify_ctx_head; | 159 | struct SamplerNotifyUpdateCTX *notify_ctx_head; |
160 | struct SamplerNotifyUpdateCTX *notify_ctx_tail; | 160 | struct SamplerNotifyUpdateCTX *notify_ctx_tail; |
161 | #ifdef TO_FILE | ||
162 | /** | ||
163 | * File name to log to | ||
164 | */ | ||
165 | char *file_name; | ||
166 | #endif /* TO_FILE */ | ||
167 | }; | 161 | }; |
168 | 162 | ||
169 | 163 | ||