Profiling driver for the testbed. More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_testbed_service.h"
#include "testbed_api_hosts.h"
Go to the source code of this file.
Macros | |
#define | LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) |
Generic loggins shorthand. More... | |
Functions | |
static void | do_shutdown (void *cls) |
Shutdown nicely. More... | |
static void | do_abort (void *cls) |
abort task to run on test timed out More... | |
static void | print_overlay_links_summary () |
Function to print summary about how many overlay links we have made and how many failed. More... | |
static void | controller_event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) |
Controller event callback. More... | |
static void | test_run (void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **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 *config) |
Main function that will be run by the scheduler. More... | |
int | main (int argc, char *const *argv) |
Main function. More... | |
Variables | |
struct GNUNET_CONFIGURATION_Handle * | cfg |
Handle to global configuration. More... | |
struct GNUNET_TESTBED_Operation * | topology_op |
Peer linking - topology operation. More... | |
static char * | hosts_file |
Name of the file with the hosts to run the test over (configuration option). More... | |
static struct GNUNET_SCHEDULER_Task * | abort_task |
Abort task identifier. More... | |
uint64_t | event_mask |
Global event mask for all testbed events. More... | |
static unsigned int | num_peers |
Number of peers to be started by the profiler. More... | |
static unsigned int | num_cont_fails |
Number of timeout failures to tolerate. More... | |
static unsigned int | cont_fails |
Continuous failures during overlay connect operations. More... | |
static unsigned int | established_links |
Links which are successfully established. More... | |
static unsigned int | failed_links |
Links which are not successfully established. More... | |
static int | result |
Global testing status. More... | |
static int | noninteractive |
Are we running non interactively. More... | |
Profiling driver for the testbed.
Definition in file gnunet-testbed-profiler.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log (kind, __VA_ARGS__) |
Generic loggins shorthand.
Definition at line 35 of file gnunet-testbed-profiler.c.
|
static |
Shutdown nicely.
cls | NULL |
Definition at line 107 of file gnunet-testbed-profiler.c.
References abort_task, cfg, GNUNET_CONFIGURATION_destroy(), and GNUNET_SCHEDULER_cancel().
Referenced by test_run().
|
static |
abort task to run on test timed out
cls | NULL |
Definition at line 128 of file gnunet-testbed-profiler.c.
References abort_task, GNUNET_ERROR_TYPE_WARNING, GNUNET_SCHEDULER_shutdown(), GNUNET_SYSERR, LOG, and result.
Referenced by run().
|
static |
Function to print summary about how many overlay links we have made and how many failed.
Definition at line 143 of file gnunet-testbed-profiler.c.
References established_links, failed_links, and GNUNET_YES.
Referenced by controller_event_cb(), and test_run().
|
static |
Controller event callback.
cls | NULL |
event | the controller event |
Definition at line 162 of file gnunet-testbed-profiler.c.
References cont_fails, GNUNET_TESTBED_EventInformation::details, established_links, failed_links, GNUNET_break, GNUNET_SCHEDULER_shutdown(), GNUNET_TESTBED_ET_CONNECT, GNUNET_TESTBED_ET_OPERATION_FINISHED, num_cont_fails, GNUNET_TESTBED_EventInformation::operation_finished, print_overlay_links_summary(), and GNUNET_TESTBED_EventInformation::type.
Referenced by run().
|
static |
Signature of a main function for a testcase.
cls | closure |
h | the run handle |
num_peers | number of peers in 'peers' |
peers | handle to peers run in the testbed |
links_succeeded | the number of overlay link connection attempts that succeeded |
links_failed | the number of overlay link |
Definition at line 214 of file gnunet-testbed-profiler.c.
References abort_task, do_shutdown(), GNUNET_OK, GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_cancel(), GNUNET_SCHEDULER_shutdown(), noninteractive, print_overlay_links_summary(), and result.
Referenced by run().
|
static |
Main function that will be run by the scheduler.
cls | closure |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
config | configuration |
Definition at line 248 of file gnunet-testbed-profiler.c.
References _, abort_task, cfg, config, controller_event_cb(), do_abort(), event_mask, GNUNET_CONFIGURATION_dup(), GNUNET_ERROR_TYPE_ERROR, GNUNET_SCHEDULER_add_shutdown(), GNUNET_TESTBED_ET_CONNECT, GNUNET_TESTBED_ET_OPERATION_FINISHED, GNUNET_TESTBED_run(), hosts_file, LOG, num_peers, and test_run().
Referenced by main().
int main | ( | int | argc, |
char *const * | argv | ||
) |
Main function.
Definition at line 276 of file gnunet-testbed-profiler.c.
References gettext_noop, GNUNET_free_nz, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_GETOPT_option_uint(), GNUNET_OK, GNUNET_PROGRAM_run(), GNUNET_STRINGS_get_utf8_args(), GNUNET_SYSERR, hosts_file, noninteractive, num_cont_fails, num_peers, options, result, ret, and run().
struct GNUNET_CONFIGURATION_Handle* cfg |
Handle to global configuration.
Handle to our configuration.
Definition at line 42 of file gnunet-testbed-profiler.c.
Referenced by do_shutdown(), and run().
struct GNUNET_TESTBED_Operation* topology_op |
Peer linking - topology operation.
Definition at line 47 of file gnunet-testbed-profiler.c.
|
static |
Name of the file with the hosts to run the test over (configuration option).
It will be NULL if ENABLE_LL is set
Definition at line 53 of file gnunet-testbed-profiler.c.
|
static |
Abort task identifier.
Definition at line 58 of file gnunet-testbed-profiler.c.
Referenced by do_abort(), do_shutdown(), run(), and test_run().
uint64_t event_mask |
Global event mask for all testbed events.
Definition at line 63 of file gnunet-testbed-profiler.c.
Referenced by controller_status_cb(), GNUNET_TESTBED_controller_connect(), GNUNET_TESTBED_run(), GNUNET_TESTBED_test_run(), and run().
|
static |
Number of peers to be started by the profiler.
Definition at line 68 of file gnunet-testbed-profiler.c.
|
static |
Number of timeout failures to tolerate.
Definition at line 73 of file gnunet-testbed-profiler.c.
Referenced by controller_event_cb(), and main().
|
static |
Continuous failures during overlay connect operations.
Definition at line 78 of file gnunet-testbed-profiler.c.
Referenced by controller_event_cb().
|
static |
Links which are successfully established.
Definition at line 83 of file gnunet-testbed-profiler.c.
Referenced by controller_event_cb(), and print_overlay_links_summary().
|
static |
Links which are not successfully established.
Definition at line 88 of file gnunet-testbed-profiler.c.
Referenced by controller_event_cb(), and print_overlay_links_summary().
|
static |
Global testing status.
Definition at line 93 of file gnunet-testbed-profiler.c.
Referenced by do_abort(), main(), and test_run().
|
static |
Are we running non interactively.
Definition at line 98 of file gnunet-testbed-profiler.c.
Referenced by main(), and test_run().