diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-31 13:03:48 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-31 13:03:48 +0100 |
commit | 7e3cf5f461eb4fbb7581672bf0835da07c378136 (patch) | |
tree | bdc3874b7894242b095b892f1ed3e81a4d4f06c0 /src/statistics | |
parent | 01b480d6d026e0c537dc284a7e7df2c0320a3528 (diff) | |
download | gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.tar.gz gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.zip |
tighten formatting rules
Diffstat (limited to 'src/statistics')
-rw-r--r-- | src/statistics/gnunet-service-statistics.c | 5 | ||||
-rw-r--r-- | src/statistics/gnunet-statistics.c | 13 | ||||
-rw-r--r-- | src/statistics/statistics_api.c | 4 | ||||
-rw-r--r-- | src/statistics/test_statistics_api.c | 1 | ||||
-rw-r--r-- | src/statistics/test_statistics_api_loop.c | 1 | ||||
-rw-r--r-- | src/statistics/test_statistics_api_watch_zero_value.c | 1 |
6 files changed, 21 insertions, 4 deletions
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c index 3de481e77..ba6a614c8 100644 --- a/src/statistics/gnunet-service-statistics.c +++ b/src/statistics/gnunet-service-statistics.c | |||
@@ -1048,12 +1048,15 @@ GNUNET_SERVICE_MAIN ( | |||
1048 | /** | 1048 | /** |
1049 | * MINIMIZE heap size (way below 128k) since this process doesn't need much. | 1049 | * MINIMIZE heap size (way below 128k) since this process doesn't need much. |
1050 | */ | 1050 | */ |
1051 | void __attribute__ ((constructor)) GNUNET_STATISTICS_memory_init () | 1051 | void __attribute__ ((constructor)) |
1052 | GNUNET_STATISTICS_memory_init () | ||
1052 | { | 1053 | { |
1053 | mallopt (M_TRIM_THRESHOLD, 4 * 1024); | 1054 | mallopt (M_TRIM_THRESHOLD, 4 * 1024); |
1054 | mallopt (M_TOP_PAD, 1 * 1024); | 1055 | mallopt (M_TOP_PAD, 1 * 1024); |
1055 | malloc_trim (0); | 1056 | malloc_trim (0); |
1056 | } | 1057 | } |
1058 | |||
1059 | |||
1057 | #endif | 1060 | #endif |
1058 | 1061 | ||
1059 | 1062 | ||
diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c index aba80ab36..e004a0f1c 100644 --- a/src/statistics/gnunet-statistics.c +++ b/src/statistics/gnunet-statistics.c | |||
@@ -192,6 +192,7 @@ new_value_set (const char *subsystem, | |||
192 | return value_set; | 192 | return value_set; |
193 | } | 193 | } |
194 | 194 | ||
195 | |||
195 | /** | 196 | /** |
196 | * @brief Print the (collected) values. | 197 | * @brief Print the (collected) values. |
197 | * | 198 | * |
@@ -258,6 +259,7 @@ printer (void *cls, const struct GNUNET_HashCode *key, void *value) | |||
258 | return GNUNET_YES; | 259 | return GNUNET_YES; |
259 | } | 260 | } |
260 | 261 | ||
262 | |||
261 | /** | 263 | /** |
262 | * Callback function to process statistic values. | 264 | * Callback function to process statistic values. |
263 | * | 265 | * |
@@ -318,6 +320,7 @@ printer_watch (void *cls, | |||
318 | return GNUNET_OK; | 320 | return GNUNET_OK; |
319 | } | 321 | } |
320 | 322 | ||
323 | |||
321 | /** | 324 | /** |
322 | * @brief Clean all data structures related to given node. | 325 | * @brief Clean all data structures related to given node. |
323 | * | 326 | * |
@@ -372,6 +375,7 @@ clean_node (void *cls) | |||
372 | } | 375 | } |
373 | } | 376 | } |
374 | 377 | ||
378 | |||
375 | /** | 379 | /** |
376 | * @brief Print and shutdown | 380 | * @brief Print and shutdown |
377 | * | 381 | * |
@@ -384,6 +388,7 @@ print_finish (void *cls) | |||
384 | GNUNET_SCHEDULER_shutdown (); | 388 | GNUNET_SCHEDULER_shutdown (); |
385 | } | 389 | } |
386 | 390 | ||
391 | |||
387 | /** | 392 | /** |
388 | * @brief Called once all statistic values are available. | 393 | * @brief Called once all statistic values are available. |
389 | * | 394 | * |
@@ -422,6 +427,7 @@ continuation_print (void *cls, int success) | |||
422 | } | 427 | } |
423 | } | 428 | } |
424 | 429 | ||
430 | |||
425 | /** | 431 | /** |
426 | * Function called last by the statistics code. | 432 | * Function called last by the statistics code. |
427 | * | 433 | * |
@@ -450,6 +456,7 @@ cleanup (void *cls, int success) | |||
450 | GNUNET_SCHEDULER_shutdown (); | 456 | GNUNET_SCHEDULER_shutdown (); |
451 | } | 457 | } |
452 | 458 | ||
459 | |||
453 | /** | 460 | /** |
454 | * @brief Iterate over statistics values and store them in #values. | 461 | * @brief Iterate over statistics values and store them in #values. |
455 | * They will be printed once all are available. | 462 | * They will be printed once all are available. |
@@ -500,6 +507,7 @@ collector (void *cls, | |||
500 | return GNUNET_OK; | 507 | return GNUNET_OK; |
501 | } | 508 | } |
502 | 509 | ||
510 | |||
503 | /** | 511 | /** |
504 | * Main task that does the actual work. | 512 | * Main task that does the actual work. |
505 | * | 513 | * |
@@ -582,6 +590,7 @@ main_task (void *cls) | |||
582 | GNUNET_SCHEDULER_add_shutdown (&clean_node, &nodes[index_node].index_node); | 590 | GNUNET_SCHEDULER_add_shutdown (&clean_node, &nodes[index_node].index_node); |
583 | } | 591 | } |
584 | 592 | ||
593 | |||
585 | /** | 594 | /** |
586 | * @brief Iter over content of a node's directory to check for existence of a | 595 | * @brief Iter over content of a node's directory to check for existence of a |
587 | * config file. | 596 | * config file. |
@@ -617,6 +626,7 @@ iter_check_config (void *cls, const char *filename) | |||
617 | } | 626 | } |
618 | } | 627 | } |
619 | 628 | ||
629 | |||
620 | /** | 630 | /** |
621 | * @brief Iterates over filenames in testbed directory. | 631 | * @brief Iterates over filenames in testbed directory. |
622 | * | 632 | * |
@@ -649,6 +659,7 @@ iter_testbed_path (void *cls, const char *filename) | |||
649 | return GNUNET_OK; | 659 | return GNUNET_OK; |
650 | } | 660 | } |
651 | 661 | ||
662 | |||
652 | /** | 663 | /** |
653 | * @brief Count the number of nodes running in the testbed | 664 | * @brief Count the number of nodes running in the testbed |
654 | * | 665 | * |
@@ -671,6 +682,7 @@ discover_testbed_nodes (const char *path_testbed) | |||
671 | return 0; | 682 | return 0; |
672 | } | 683 | } |
673 | 684 | ||
685 | |||
674 | /** | 686 | /** |
675 | * Main function that will be run by the scheduler. | 687 | * Main function that will be run by the scheduler. |
676 | * | 688 | * |
@@ -857,4 +869,5 @@ main (int argc, char *const *argv) | |||
857 | return ret; | 869 | return ret; |
858 | } | 870 | } |
859 | 871 | ||
872 | |||
860 | /* end of gnunet-statistics.c */ | 873 | /* end of gnunet-statistics.c */ |
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index 1f3dfcfa6..869d51544 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c | |||
@@ -739,8 +739,7 @@ reconnect_later (struct GNUNET_STATISTICS_Handle *h) | |||
739 | * Chances are that it's down for good and we are not going to connect to | 739 | * Chances are that it's down for good and we are not going to connect to |
740 | * it anymore. | 740 | * it anymore. |
741 | * Give up and don't sync the rest of the data. | 741 | * Give up and don't sync the rest of the data. |
742 | */ | 742 | */loss = GNUNET_NO; |
743 | loss = GNUNET_NO; | ||
744 | for (gh = h->action_head; NULL != gh; gh = gh->next) | 743 | for (gh = h->action_head; NULL != gh; gh = gh->next) |
745 | if ((gh->make_persistent) && | 744 | if ((gh->make_persistent) && |
746 | (ACTION_SET == gh->type)) | 745 | (ACTION_SET == gh->type)) |
@@ -762,7 +761,6 @@ reconnect_later (struct GNUNET_STATISTICS_Handle *h) | |||
762 | } | 761 | } |
763 | 762 | ||
764 | 763 | ||
765 | |||
766 | /** | 764 | /** |
767 | * Transmit a GET request (and if successful, start to receive | 765 | * Transmit a GET request (and if successful, start to receive |
768 | * the response). | 766 | * the response). |
diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c index 9ff02d510..fcdeccad6 100644 --- a/src/statistics/test_statistics_api.c +++ b/src/statistics/test_statistics_api.c | |||
@@ -249,4 +249,5 @@ main (int argc, char *argv_ign[]) | |||
249 | return ok; | 249 | return ok; |
250 | } | 250 | } |
251 | 251 | ||
252 | |||
252 | /* end of test_statistics_api.c */ | 253 | /* end of test_statistics_api.c */ |
diff --git a/src/statistics/test_statistics_api_loop.c b/src/statistics/test_statistics_api_loop.c index 54de96107..50507bdc4 100644 --- a/src/statistics/test_statistics_api_loop.c +++ b/src/statistics/test_statistics_api_loop.c | |||
@@ -118,4 +118,5 @@ main (int argc, char *argv_ign[]) | |||
118 | return ok; | 118 | return ok; |
119 | } | 119 | } |
120 | 120 | ||
121 | |||
121 | /* end of test_statistics_api_loop.c */ | 122 | /* end of test_statistics_api_loop.c */ |
diff --git a/src/statistics/test_statistics_api_watch_zero_value.c b/src/statistics/test_statistics_api_watch_zero_value.c index 67cfb4c46..80ca57c18 100644 --- a/src/statistics/test_statistics_api_watch_zero_value.c +++ b/src/statistics/test_statistics_api_watch_zero_value.c | |||
@@ -192,4 +192,5 @@ main (int argc, char *argv_ign[]) | |||
192 | return 1; | 192 | return 1; |
193 | } | 193 | } |
194 | 194 | ||
195 | |||
195 | /* end of test_statistics_api_watch_zero_value.c */ | 196 | /* end of test_statistics_api_watch_zero_value.c */ |