mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
smaller fixes and cleanups
This commit is contained in:
parent
0524afa630
commit
85f3707554
5 changed files with 31 additions and 4 deletions
|
@ -21,7 +21,6 @@
|
|||
#include <libconfig.h>
|
||||
|
||||
#include "msg.h"
|
||||
#include "tc.h"
|
||||
#include "list.h"
|
||||
|
||||
/** Static node initialization */
|
||||
|
|
|
@ -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
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -6,18 +6,21 @@
|
|||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
*********************************************************************************/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sched.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sched.h>
|
||||
|
||||
#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");
|
||||
|
|
Loading…
Add table
Reference in a new issue