diff --git a/server/include/node.h b/server/include/node.h index 86509322c..7d3b5e584 100644 --- a/server/include/node.h +++ b/server/include/node.h @@ -21,7 +21,6 @@ #include #include "msg.h" -#include "tc.h" #include "list.h" /** Static node initialization */ diff --git a/server/include/stats.h b/server/include/stats.h index 324476163..992a45a2e 100644 --- a/server/include/stats.h +++ b/server/include/stats.h @@ -13,16 +13,24 @@ /* Forward declarations */ struct path; +/** Print a table header for statistics printed by stats_line() */ +void stats_header(); + +/** Print a single line of stats including received, sent, invalid and dropped packet counters */ int stats_line(struct path *p); int stats_show(struct path *p); +/** Update histograms */ int stats_collect(struct path *p); +/** Create histograms */ int stats_start(struct path *p); +/** Destroy histograms */ int stats_stop(struct path *p); +/** Reset all statistic counters to zero */ int stats_reset(struct path *p); #endif \ No newline at end of file diff --git a/server/src/gtfpga.c b/server/src/gtfpga.c index bfe380d19..1a07e1beb 100644 --- a/server/src/gtfpga.c +++ b/server/src/gtfpga.c @@ -33,6 +33,9 @@ static void gtfpga_debug(char *msg, ...) { int gtfpga_init(int argc, char * argv[], struct settings *set) { pacc = pci_alloc(); /* Get the pci_access structure */ + if (!pacc) + error("Failed to allocate PCI access structure"); + pci_init(pacc); /* Initialize the PCI library */ pacc->error = (log_cb_t) error; /* Replace logging and debug functions */ diff --git a/server/src/path.c b/server/src/path.c index 7cba1b218..72fffc19f 100644 --- a/server/src/path.c +++ b/server/src/path.c @@ -207,7 +207,6 @@ struct path * path_create() hook_add(HOOK_PATH_START, 1, stats_start); - hook_add(HOOK_PATH_STOP, 1, stats_line); hook_add(HOOK_PATH_STOP, 2, stats_show); hook_add(HOOK_PATH_STOP, 3, stats_stop); diff --git a/server/src/server.c b/server/src/server.c index c2dd84b9c..4f6a9a114 100644 --- a/server/src/server.c +++ b/server/src/server.c @@ -6,18 +6,21 @@ * Unauthorized copying of this file, via any medium is strictly prohibited. *********************************************************************************/ + #include #include -#include #include #include +#include + #include "config.h" #include "utils.h" #include "cfg.h" #include "path.h" #include "node.h" +#include "stats.h" #include "license.h" #ifdef ENABLE_OPAL_ASYNC @@ -43,6 +46,7 @@ static void quit() FOREACH(&nodes, it) node_stop(it->node); + info("De-initializing node types"); node_deinit(); /* Freeing dynamically allocated memory */ @@ -59,7 +63,10 @@ static void realtime_init() { INDENT /* Use FIFO scheduler with real time priority */ if (settings.priority) { - struct sched_param param = { .sched_priority = settings.priority }; + struct sched_param param = { + .sched_priority = settings.priority + }; + if (sched_setscheduler(0, SCHED_FIFO, ¶m)) serror("Failed to set real time priority"); else @@ -98,6 +105,17 @@ static void usage(const char *name) printf(" This type of invocation is used by OPAL-RT Asynchronous processes.\n"); printf(" See in the RT-LAB User Guide for more information.\n\n"); #endif + printf("Supported features:\n"); +#ifdef ENABLE_PCI + printf(" - libpci: GTFPGA PCIe card\n"); +#endif +#ifdef ENABLE_SOCKET + printf(" - libnl3: Network Emulation\n"); +#endif +#ifdef ENABLE_OPAL_ASYNC + printf(" - libOpalAsyncApi: run as OPAL Asynchronous Process\n"); +#endif + printf("\n"); printf("Simulator2Simulator Server %s (built on %s %s)\n", BLU(VERSION), MAG(__DATE__), MAG(__TIME__)); printf(" copyright 2014-2015, Institute for Automation of Complex Power Systems, EONERC\n");