profiling tool for set More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_set_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_SET_Element *element, uint64_t current_size, enum GNUNET_SET_Status status) |
static void | set_listen_cb (void *cls, const struct GNUNET_PeerIdentity *other_peer, const struct GNUNET_MessageHeader *context_msg, struct GNUNET_SET_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 char * | op_str = "union" |
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_SET_ListenHandle * | set_listener |
static int | byzantine |
static unsigned int | force_delta |
static unsigned int | force_full |
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... | |
profiling tool for set
Definition in file gnunet-set-profiler.c.
|
static |
Definition at line 85 of file gnunet-set-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 112 of file gnunet-set-profiler.c.
References GNUNET_OK, name, statistics_file, subsystem, and value.
Referenced by check_all_done().
|
static |
Definition at line 128 of file gnunet-set-profiler.c.
References GNUNET_assert, GNUNET_SCHEDULER_shutdown(), GNUNET_YES, and statistics_file.
Referenced by check_all_done().
|
static |
Definition at line 139 of file gnunet-set-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 168 of file gnunet-set-profiler.c.
References check_all_done(), GNUNET_SET_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_SET_STATUS_ADD_LOCAL, GNUNET_SET_STATUS_ADD_REMOTE, GNUNET_SET_STATUS_DONE, GNUNET_SET_STATUS_FAILURE, GNUNET_SET_STATUS_HALF_DONE, GNUNET_YES, info, GNUNET_SET_Element::size, and status.
Referenced by run(), and set_listen_cb().
|
static |
Definition at line 229 of file gnunet-set-profiler.c.
References byzantine, force_delta, force_full, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_SET_accept(), GNUNET_SET_commit(), GNUNET_SET_OPTION_BYZANTINE, GNUNET_SET_OPTION_FORCE_DELTA, GNUNET_SET_OPTION_FORCE_FULL, GNUNET_SET_RESULT_SYMMETRIC, info2, SetInfo::oh, gnunet-chk::opts, request, SetInfo::set, and set_result_cb().
Referenced by run().
|
static |
Definition at line 273 of file gnunet-set-profiler.c.
References el, element_size, GNUNET_SET_add_element(), GNUNET_YES, and value.
Referenced by run().
|
static |
Definition at line 289 of file gnunet-set-profiler.c.
References GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_NO, GNUNET_SET_destroy(), GNUNET_SET_listen_cancel(), GNUNET_SET_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-set-profiler.c.
References app_id, byzantine, cfg, common_sent, config, data, element_size, force_delta, force_full, 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_SET_commit(), GNUNET_SET_create(), GNUNET_SET_destroy(), GNUNET_SET_listen(), GNUNET_SET_OPERATION_UNION, GNUNET_SET_OPTION_BYZANTINE, GNUNET_SET_OPTION_FORCE_DELTA, GNUNET_SET_OPTION_FORCE_FULL, GNUNET_SET_prepare(), GNUNET_SET_RESULT_SYMMETRIC, 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(), and statistics.
Referenced by pre_run().
|
static |
Definition at line 434 of file gnunet-set-profiler.c.
References GNUNET_TESTING_peer_run(), ret, and run().
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 445 of file gnunet-set-profiler.c.
References byzantine, element_size, force_delta, force_full, gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_filename(), GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_GETOPT_option_uint(), GNUNET_PROGRAM_run2(), GNUNET_YES, num_a, num_b, num_c, op_str, options, pre_run(), ret, and statistics_filename.
|
static |
Definition at line 33 of file gnunet-set-profiler.c.
Referenced by main(), map_remove_iterator(), pre_run(), and run().
|
static |
Definition at line 35 of file gnunet-set-profiler.c.
|
static |
Definition at line 36 of file gnunet-set-profiler.c.
|
static |
Definition at line 37 of file gnunet-set-profiler.c.
|
static |
Definition at line 39 of file gnunet-set-profiler.c.
Referenced by main().
|
static |
Definition at line 41 of file gnunet-set-profiler.c.
Referenced by create_service(), GNUNET_TESTBED_compress_cfg_(), GNUNET_TESTBED_compress_config_(), GNUNET_TESTBED_create_helper_init_msg_(), GNUNET_TESTBED_is_host_habitable(), GNUNET_TESTBED_register_host(), handle_peer_get_config(), handle_slave_get_config(), helper_mst(), init_ego_store(), opstart_peer_create(), run(), set_value(), setup_service(), and tokenizer_cb().
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 53 of file gnunet-set-profiler.c.
Referenced by run().
|
static |
Definition at line 53 of file gnunet-set-profiler.c.
Referenced by GNUNET_SET_listen(), GNUNET_SET_prepare(), GNUNET_SETI_listen(), GNUNET_SETI_prepare(), GNUNET_SETU_listen(), GNUNET_SETU_prepare(), and run().
|
static |
Definition at line 53 of file gnunet-set-profiler.c.
Referenced by run().
|
static |
Definition at line 59 of file gnunet-set-profiler.c.
Referenced by handle_shutdown(), and run().
|
static |
Definition at line 61 of file gnunet-set-profiler.c.
Referenced by main(), run(), and set_listen_cb().
|
static |
Definition at line 62 of file gnunet-set-profiler.c.
Referenced by main(), run(), and set_listen_cb().
|
static |
Definition at line 63 of file gnunet-set-profiler.c.
Referenced by main(), run(), and set_listen_cb().
|
static |
Definition at line 64 of file gnunet-set-profiler.c.
Referenced by check_valid_phase(), handle_client_insert(), handle_union_p2p_elements(), handle_union_p2p_full_element(), insert_round2_element(), main(), run(), set_insert_iterator(), and set_result_cb().
|
static |
Handle to the statistics service.
Definition at line 69 of file gnunet-set-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 75 of file gnunet-set-profiler.c.
Referenced by check_all_done(), and main().
|
static |
The profiler will write statistics for all peers to this file.
Definition at line 81 of file gnunet-set-profiler.c.
Referenced by check_all_done(), statistics_done(), and statistics_result().