#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_seti_service.h"
#include "gnunet_testbed_service.h"
Go to the source code of this file.
Data Structures | |
struct | SetInfo |
Functions | |
static int | map_remove_iterator (void *cls, const struct GNUNET_HashCode *key, void *value) |
static int | statistics_result (void *cls, const char *subsystem, const char *name, uint64_t value, int is_persistent) |
Callback function to process statistic values. More... | |
static void | statistics_done (void *cls, int success) |
static void | check_all_done (void) |
static void | set_result_cb (void *cls, const struct GNUNET_SETI_Element *element, uint64_t current_size, enum GNUNET_SETI_Status status) |
static void | set_listen_cb (void *cls, const struct GNUNET_PeerIdentity *other_peer, const struct GNUNET_MessageHeader *context_msg, struct GNUNET_SETI_Request *request) |
static int | set_insert_iterator (void *cls, const struct GNUNET_HashCode *key, void *value) |
static void | handle_shutdown (void *cls) |
static void | run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Peer *peer) |
static void | pre_run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
int | main (int argc, char **argv) |
Variables | |
static int | ret |
static unsigned int | num_a = 5 |
static unsigned int | num_b = 5 |
static unsigned int | num_c = 20 |
static const struct GNUNET_CONFIGURATION_Handle * | config |
struct SetInfo | info1 |
struct SetInfo | info2 |
static struct GNUNET_CONTAINER_MultiHashMap * | common_sent |
static struct GNUNET_HashCode | app_id |
static struct GNUNET_PeerIdentity | local_peer |
static struct GNUNET_SETI_ListenHandle * | set_listener |
static unsigned int | use_intersection |
static unsigned int | element_size = 32 |
static struct GNUNET_STATISTICS_Handle * | statistics |
Handle to the statistics service. More... | |
static char * | statistics_filename |
The profiler will write statistics for all peers to the file with this name. More... | |
static FILE * | statistics_file |
The profiler will write statistics for all peers to this file. More... | |
|
static |
Definition at line 82 of file gnunet-seti-profiler.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap_remove_all(), GNUNET_OK, GNUNET_YES, key, m, and ret.
Referenced by check_all_done().
|
static |
Callback function to process statistic values.
cls | closure |
subsystem | name of subsystem that created the statistic |
name | the name of the datum |
value | the current value |
is_persistent | GNUNET_YES if the value is persistent, GNUNET_NO if not |
Definition at line 109 of file gnunet-seti-profiler.c.
References GNUNET_OK, name, statistics_file, subsystem, and value.
Referenced by check_all_done().
|
static |
Definition at line 125 of file gnunet-seti-profiler.c.
References GNUNET_assert, GNUNET_SCHEDULER_shutdown(), GNUNET_YES, and statistics_file.
Referenced by check_all_done().
|
static |
Definition at line 136 of file gnunet-seti-profiler.c.
References SetInfo::done, GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_NO, GNUNET_SCHEDULER_shutdown(), GNUNET_STATISTICS_get(), info1, info2, map_remove_iterator(), SetInfo::received, SetInfo::sent, statistics, statistics_done(), statistics_file, statistics_filename, and statistics_result().
Referenced by set_result_cb().
|
static |
Definition at line 165 of file gnunet-seti-profiler.c.
References check_all_done(), GNUNET_SETI_Element::data, element_size, GNUNET_assert, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE, GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_h2s(), GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_shutdown(), GNUNET_SETI_STATUS_ADD_LOCAL, GNUNET_SETI_STATUS_DEL_LOCAL, GNUNET_SETI_STATUS_DONE, GNUNET_SETI_STATUS_FAILURE, GNUNET_YES, info, GNUNET_SETI_Element::size, and status.
Referenced by run(), and set_listen_cb().
|
static |
Definition at line 239 of file gnunet-seti-profiler.c.
References GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_SETI_accept(), GNUNET_SETI_commit(), GNUNET_SETI_OPTION_END, GNUNET_SETI_OPTION_RETURN_INTERSECTION, info2, SetInfo::oh, gnunet-chk::opts, request, SetInfo::set, set_result_cb(), and use_intersection.
Referenced by run().
|
static |
Definition at line 273 of file gnunet-seti-profiler.c.
References el, element_size, GNUNET_SETI_add_element(), GNUNET_YES, and value.
Referenced by run().
|
static |
Definition at line 289 of file gnunet-seti-profiler.c.
References GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_NO, GNUNET_SETI_destroy(), GNUNET_SETI_listen_cancel(), GNUNET_SETI_operation_cancel(), GNUNET_STATISTICS_destroy(), info1, info2, SetInfo::oh, SetInfo::set, set_listener, and statistics.
Referenced by run().
|
static |
Definition at line 323 of file gnunet-seti-profiler.c.
References app_id, cfg, common_sent, config, data, element_size, GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE, GNUNET_CRYPTO_get_peer_identity(), GNUNET_CRYPTO_hash(), GNUNET_CRYPTO_hash_create_random(), GNUNET_CRYPTO_QUALITY_STRONG, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_block(), GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_malloc, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_shutdown(), GNUNET_SETI_commit(), GNUNET_SETI_create(), GNUNET_SETI_destroy(), GNUNET_SETI_listen(), GNUNET_SETI_OPTION_END, GNUNET_SETI_OPTION_RETURN_INTERSECTION, GNUNET_SETI_prepare(), GNUNET_STATISTICS_create(), handle_shutdown(), SetInfo::id, info1, info2, local_peer, num_a, num_b, num_c, SetInfo::oh, gnunet-chk::opts, SetInfo::received, ret, SetInfo::sent, SetInfo::set, set_insert_iterator(), set_listen_cb(), set_listener, set_result_cb(), statistics, and use_intersection.
Referenced by pre_run().
|
static |
Definition at line 422 of file gnunet-seti-profiler.c.
References GNUNET_TESTING_peer_run(), ret, and run().
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 435 of file gnunet-seti-profiler.c.
References element_size, gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_filename(), GNUNET_GETOPT_option_uint(), GNUNET_PROGRAM_run2(), GNUNET_YES, num_a, num_b, num_c, options, pre_run(), ret, statistics_filename, and use_intersection.
|
static |
Definition at line 33 of file gnunet-seti-profiler.c.
Referenced by main(), map_remove_iterator(), pre_run(), and run().
|
static |
Definition at line 35 of file gnunet-seti-profiler.c.
|
static |
Definition at line 36 of file gnunet-seti-profiler.c.
|
static |
Definition at line 37 of file gnunet-seti-profiler.c.
|
static |
Definition at line 39 of file gnunet-seti-profiler.c.
Referenced by run().
struct SetInfo info1 |
Referenced by check_all_done(), handle_shutdown(), and run().
struct SetInfo info2 |
Referenced by check_all_done(), handle_shutdown(), run(), and set_listen_cb().
|
static |
Definition at line 51 of file gnunet-seti-profiler.c.
Referenced by run().
|
static |
Definition at line 51 of file gnunet-seti-profiler.c.
Referenced by run().
|
static |
Definition at line 51 of file gnunet-seti-profiler.c.
Referenced by run().
|
static |
Definition at line 57 of file gnunet-seti-profiler.c.
Referenced by handle_shutdown(), and run().
|
static |
Definition at line 59 of file gnunet-seti-profiler.c.
Referenced by main(), run(), and set_listen_cb().
|
static |
Definition at line 61 of file gnunet-seti-profiler.c.
Referenced by main(), run(), set_insert_iterator(), and set_result_cb().
|
static |
Handle to the statistics service.
Definition at line 66 of file gnunet-seti-profiler.c.
Referenced by check_all_done(), handle_shutdown(), and run().
|
static |
The profiler will write statistics for all peers to the file with this name.
Definition at line 72 of file gnunet-seti-profiler.c.
Referenced by check_all_done(), and main().
|
static |
The profiler will write statistics for all peers to this file.
Definition at line 78 of file gnunet-seti-profiler.c.
Referenced by check_all_done(), statistics_done(), and statistics_result().