profiling tool for gnunet-consensus More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_time_lib.h"
#include "gnunet_consensus_service.h"
#include "gnunet_testbed_service.h"
Go to the source code of this file.
Functions | |
static void | controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) |
Signature of the event handler function called by the respective event controller. More... | |
static void | statistics_done_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg) |
static int | statistics_cb (void *cls, const struct GNUNET_TESTBED_Peer *peer, const char *subsystem, const char *name, uint64_t value, int is_persistent) |
Callback function to process statistic values from all peers. More... | |
static void | destroy (void *cls) |
static void | conclude_cb (void *cls) |
Called when a conclusion was successful. More... | |
static void | generate_indices (int *indices) |
static void | do_consensus () |
static void | connect_complete (void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, const char *emsg) |
Callback to be called when a service connect operation is completed. More... | |
static void | new_element_cb (void *cls, const struct GNUNET_SET_Element *element) |
static void * | connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Adapter function called to establish a connection to a service. More... | |
static void | disconnect_adapter (void *cls, void *op_result) |
Adapter function called to destroy a connection to a service. More... | |
static void | peer_info_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op, const struct GNUNET_TESTBED_PeerInformation *pinfo, const char *emsg) |
Callback to be called when the requested peer information is available. More... | |
static void | test_master (void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **started_peers, unsigned int links_succeeded, unsigned int links_failed) |
Signature of a main function for a testcase. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
int | main (int argc, char **argv) |
Variables | |
static unsigned int | num_peers = 2 |
static unsigned int | replication = 1 |
static unsigned int | num_values = 5 |
static struct GNUNET_TIME_Relative | conclude_timeout |
static struct GNUNET_TIME_Relative | consensus_delay |
static struct GNUNET_CONSENSUS_Handle ** | consensus_handles |
static struct GNUNET_TESTBED_Operation ** | testbed_operations |
static unsigned int | num_connected_handles |
static struct GNUNET_TESTBED_Peer ** | peers |
static struct GNUNET_PeerIdentity * | peer_ids |
static unsigned int | num_retrieved_peer_ids |
static struct GNUNET_HashCode | session_id |
static unsigned int | peers_done = 0 |
static int | dist_static |
static unsigned * | results_for_peer |
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 int | verbose |
static struct GNUNET_TIME_Absolute | start |
Start time for all consensuses. More... | |
static struct GNUNET_TIME_Absolute | deadline |
Deadline for all consensuses. More... | |
profiling tool for gnunet-consensus
Definition in file gnunet-consensus-profiler.c.
|
static |
Signature of the event handler function called by the respective event controller.
cls | closure |
event | information about the event |
Definition at line 95 of file gnunet-consensus-profiler.c.
References GNUNET_assert.
Referenced by run().
|
static |
Definition at line 103 of file gnunet-consensus-profiler.c.
References GNUNET_assert, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_SCHEDULER_shutdown(), GNUNET_TESTBED_operation_done(), op, and statistics_file.
Referenced by destroy().
|
static |
Callback function to process statistic values from all peers.
cls | closure |
peer | the peer the statistic belong to |
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 130 of file gnunet-consensus-profiler.c.
References GNUNET_OK, GNUNET_TESTBED_get_index(), name, peer, statistics_file, subsystem, and value.
Referenced by destroy().
|
static |
Definition at line 147 of file gnunet-consensus-profiler.c.
References GNUNET_CONSENSUS_destroy(), GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_TESTBED_get_statistics(), GNUNET_TESTBED_operation_done(), num_peers, num_values, peers, peers_done, results_for_peer, statistics_cb(), statistics_done_cb(), statistics_file, statistics_filename, and testbed_operations.
Referenced by conclude_cb(), GNUNET_MQ_queue_for_callbacks(), and GNUNET_SERVER_set_callbacks().
|
static |
Called when a conclusion was successful.
cls | closure, the consensus handle |
Definition at line 183 of file gnunet-consensus-profiler.c.
References consensus_handles, destroy(), GNUNET_ERROR_TYPE_INFO, GNUNET_log, and GNUNET_SCHEDULER_add_now().
Referenced by do_consensus().
|
static |
Definition at line 195 of file gnunet-consensus-profiler.c.
References GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u32(), GNUNET_NO, GNUNET_YES, num_peers, and replication.
Referenced by do_consensus().
|
static |
Definition at line 220 of file gnunet-consensus-profiler.c.
References conclude_cb(), consensus_handles, GNUNET_SET_Element::data, dist_static, generate_indices(), GNUNET_CONSENSUS_conclude(), GNUNET_CONSENSUS_insert(), GNUNET_CRYPTO_hash_create_random(), GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_ERROR_TYPE_INFO, GNUNET_log, num_peers, num_values, replication, and GNUNET_SET_Element::size.
Referenced by connect_complete().
|
static |
Callback to be called when a service connect operation is completed.
cls | the callback closure from functions generating an operation |
op | the operation that has been finished |
ca_result | the service handle returned from GNUNET_TESTBED_ConnectAdapter() |
emsg | error message in case the operation has failed; will be NULL if operation has executed successfully. |
Definition at line 284 of file gnunet-consensus-profiler.c.
References do_consensus(), GNUNET_assert, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_log, num_connected_handles, and num_peers.
Referenced by peer_info_cb().
|
static |
Definition at line 310 of file gnunet-consensus-profiler.c.
References consensus_handles, GNUNET_SET_Element::data, GNUNET_assert, GNUNET_h2s(), GNUNET_YES, results_for_peer, GNUNET_SET_Element::size, and verbose.
Referenced by connect_adapter(), and GNUNET_CONSENSUS_create().
|
static |
Adapter function called to establish a connection to a service.
cls | closure |
cfg | configuration of the peer to connect to; will be available until GNUNET_TESTBED_operation_done() is called on the operation returned from GNUNET_TESTBED_service_connect() |
Definition at line 342 of file gnunet-consensus-profiler.c.
References cfg, deadline, GNUNET_CONSENSUS_create(), GNUNET_ERROR_TYPE_INFO, GNUNET_log, new_element_cb(), num_peers, peer_ids, session_id, and start.
Referenced by peer_info_cb().
|
static |
Adapter function called to destroy a connection to a service.
cls | closure |
op_result | service handle returned from the connect adapter |
Definition at line 372 of file gnunet-consensus-profiler.c.
References GNUNET_ERROR_TYPE_INFO, and GNUNET_log.
Referenced by peer_info_cb().
|
static |
Callback to be called when the requested peer information is available.
cb_cls | the closure from GNUNET_TESTBED_peer_get_information() |
op | the operation this callback corresponds to |
pinfo | the result; will be NULL if the operation has failed |
emsg | error message if the operation has failed; will be NULL if the operation is successful |
Definition at line 390 of file gnunet-consensus-profiler.c.
References connect_adapter(), connect_complete(), consensus_handles, disconnect_adapter(), GNUNET_assert, GNUNET_TESTBED_operation_done(), GNUNET_TESTBED_PIT_IDENTITY, GNUNET_TESTBED_service_connect(), GNUNET_TESTBED_PeerInformation::id, num_peers, num_retrieved_peer_ids, op, p, peers, GNUNET_TESTBED_PeerInformation::pit, GNUNET_TESTBED_PeerInformation::result, and testbed_operations.
Referenced by test_master().
|
static |
Signature of a main function for a testcase.
cls | closure |
h | the run handle |
num_peers | number of peers in 'peers' |
started_peers | handle to peers run in the testbed. NULL upon timeout (see GNUNET_TESTBED_test_run()). |
links_succeeded | the number of overlay link connection attempts that succeeded |
links_failed | the number of overlay link connection attempts that failed |
Definition at line 437 of file gnunet-consensus-profiler.c.
References consensus_handles, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_log_setup(), GNUNET_malloc, GNUNET_TESTBED_peer_get_information(), GNUNET_TESTBED_PIT_IDENTITY, num_peers, peer_ids, peer_info_cb(), peers, results_for_peer, and testbed_operations.
Referenced by GNUNET_TESTBED_run(), GNUNET_TESTBED_test_run(), and run().
|
static |
Definition at line 469 of file gnunet-consensus-profiler.c.
References cfg, conclude_timeout, consensus_delay, controller_cb(), deadline, GNUNET_CONFIGURATION_get_value_string(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_TESTBED_test_run(), GNUNET_TIME_absolute_add(), GNUNET_TIME_absolute_get(), num_peers, replication, session_id, start, test_master(), and topology.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 524 of file gnunet-consensus-profiler.c.
References conclude_timeout, consensus_delay, dist_static, gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_filename(), GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_relative_time(), GNUNET_GETOPT_option_uint(), GNUNET_PROGRAM_run2(), GNUNET_TIME_UNIT_SECONDS, GNUNET_YES, num_peers, num_values, options, replication, run(), statistics_filename, and verbose.
|
static |
Definition at line 32 of file gnunet-consensus-profiler.c.
Referenced by cadet_test_run(), check_client_keygen(), check_client_seed(), check_n_peers_ready(), check_stream_input(), check_view_update(), clients_notify_stream_peer(), clients_notify_view_update(), collect_peers_cb(), collect_peers_info_cb(), connect_adapter(), connect_complete(), destroy(), dht_test_run(), do_connect(), do_consensus(), extend_path(), generate_indices(), GNUNET_CADET_TEST_ruN(), GNUNET_CONSENSUS_create(), GNUNET_DHT_TEST_run(), GNUNET_SECRETSHARING_create_session(), GNUNET_TESTBED_2dtorus_calc_links(), GNUNET_TESTBED_get_statistics(), GNUNET_TESTBED_overlay_configure_topology(), GNUNET_TESTBED_overlay_configure_topology_va(), GNUNET_TESTBED_run(), GNUNET_TESTBED_test_run(), GNUNET_TESTBED_underlay_construct_(), GNUNET_TRANSPORT_TESTING_connect_check(), GNUNET_TRANSPORT_TESTING_main_(), handle_client_seed(), handle_stream_input(), hist_update(), keygen_reveal_get_enc_preshare(), keygen_reveal_get_exp_preshare(), main(), peer_info_cb(), peers_ready_cb(), restore_valid_peers(), rfn_commit(), rfn_contest(), rfn_vote(), RPS_sampler_get_n_rand_peers(), RPS_sampler_update_with_nw_size(), run(), send_stream_peers(), stream_input_handle(), task_start_eval_echo(), task_start_grade(), test_master(), and tmain().
|
static |
Definition at line 34 of file gnunet-consensus-profiler.c.
Referenced by do_consensus(), execute_get(), execute_select(), expi_proc(), generate_indices(), get_cb(), GNUNET_DATASTORE_put(), GNUNET_FS_handle_on_demand_block(), handle_datastore_reply(), heap_plugin_put(), main(), mysql_plugin_put(), postgres_plugin_put(), process_local_reply(), process_migration_content(), process_result(), repl_proc(), run(), sqlite_plugin_put(), and transmit_item().
|
static |
Definition at line 36 of file gnunet-consensus-profiler.c.
Referenced by destroy(), do_consensus(), main(), and new_value_set().
|
static |
Definition at line 36 of file gnunet-consensus-profiler.c.
|
static |
Definition at line 36 of file gnunet-consensus-profiler.c.
|
static |
Definition at line 42 of file gnunet-consensus-profiler.c.
Referenced by conclude_cb(), do_consensus(), new_element_cb(), peer_info_cb(), and test_master().
|
static |
Definition at line 44 of file gnunet-consensus-profiler.c.
Referenced by destroy(), peer_info_cb(), and test_master().
|
static |
Definition at line 46 of file gnunet-consensus-profiler.c.
Referenced by connect_complete().
|
static |
Definition at line 48 of file gnunet-consensus-profiler.c.
Referenced by destroy(), peer_info_cb(), and test_master().
|
static |
Definition at line 50 of file gnunet-consensus-profiler.c.
Referenced by connect_adapter(), send_pull_reply(), and test_master().
|
static |
Definition at line 52 of file gnunet-consensus-profiler.c.
Referenced by peer_info_cb().
|
static |
Definition at line 52 of file gnunet-consensus-profiler.c.
Referenced by connect_adapter(), create_address(), create_ats_address(), find_exact_address(), find_session(), GAS_addresses_add(), GAS_addresses_destroy(), GAS_addresses_update(), GAS_scheduling_transmit_address_suggestion(), GNUNET_CONSENSUS_create(), GNUNET_SECRETSHARING_create_session(), handle_ats_address_suggestion(), handle_client_decrypt(), release_session(), and run().
|
static |
Definition at line 56 of file gnunet-consensus-profiler.c.
Referenced by destroy().
|
static |
Definition at line 58 of file gnunet-consensus-profiler.c.
Referenced by do_consensus(), and main().
|
static |
Definition at line 60 of file gnunet-consensus-profiler.c.
Referenced by destroy(), new_element_cb(), and test_master().
|
static |
The profiler will write statistics for all peers to the file with this name.
Definition at line 66 of file gnunet-consensus-profiler.c.
|
static |
The profiler will write statistics for all peers to this file.
Definition at line 72 of file gnunet-consensus-profiler.c.
Referenced by destroy(), statistics_cb(), and statistics_done_cb().
|
static |
Definition at line 74 of file gnunet-consensus-profiler.c.
Referenced by GNUNET_FS_TEST_download(), GNUNET_FS_TEST_publish(), main(), and new_element_cb().
|
static |
Start time for all consensuses.
Definition at line 74 of file gnunet-consensus-profiler.c.
Referenced by connect_adapter(), and run().
|
static |
Deadline for all consensuses.
Definition at line 74 of file gnunet-consensus-profiler.c.
Referenced by connect_adapter(), GNUNET_BANDWIDTH_value_get_available_until(), GNUNET_CONSENSUS_create(), GNUNET_SECRETSHARING_create_session(), GNUNET_SECRETSHARING_decrypt(), and run().