diff --git a/etc/example.conf b/etc/example.conf index 99a38f6a9..df91d2434 100644 --- a/etc/example.conf +++ b/etc/example.conf @@ -40,6 +40,9 @@ nodes = { type = "socket", # For a list of available node-types run: 'villas-node -h' vectorize = 30, # Receive and sent 30 samples per message (combining). samplelen = 10 # The maximum number of samples this node can receive + + builtin = false, # By default, all nodes will have a few builtin hooks attached to them. + # When collecting statistics or measurements these are undesired. hooks = ( { @@ -369,6 +372,9 @@ paths = ( in = "socket_node", out = "file_node", # This path includes all available example hooks. + builtin = false, # By default, all paths will have a few builtin hooks attached to them. + # When collecting statistics or measurements these are undesired. + # A complete list of supported hooks hooks = ( diff --git a/include/villas/node.h b/include/villas/node.h index 93e8f6b7c..ff890362c 100644 --- a/include/villas/node.h +++ b/include/villas/node.h @@ -49,7 +49,7 @@ struct node char *_name; /**< Singleton: A string used to print to screen. */ char *_name_long; /**< Singleton: A string used to print to screen. */ - int no_builtin; + int builtin; /**< This node should use built-in hooks by default. */ int vectorize; /**< Number of messages to send / recv at once (scatter / gather) */ int affinity; /**< CPU Affinity of this node */ int samplelen; /**< The maximum number of values this node can receive. */ diff --git a/include/villas/path.h b/include/villas/path.h index c9d09b78f..7da01f817 100644 --- a/include/villas/path.h +++ b/include/villas/path.h @@ -91,7 +91,7 @@ struct path { double rate; /**< A timeout for */ int enabled; /**< Is this path enabled. */ int reverse; /**< This path as a matching reverse path. */ - int no_builtin; /**< This path should not use built-in hooks by default. */ + int builtin; /**< This path should use built-in hooks by default. */ int queuelen; /**< The queue length for each path_destination::queue */ int samplelen; /**< Will be calculated based on path::sources.mappings */ diff --git a/lib/node.c b/lib/node.c index 32bf9491a..d1a207f55 100644 --- a/lib/node.c +++ b/lib/node.c @@ -50,7 +50,7 @@ int node_init(struct node *n, struct node_type *vt) /* Default values */ n->vectorize = 1; - n->no_builtin = 0; + n->builtin = 1; n->samplelen = DEFAULT_SAMPLELEN; list_push(&vt->instances, n); @@ -60,7 +60,7 @@ int node_init(struct node *n, struct node_type *vt) #ifdef WITH_HOOKS /* Add internal hooks if they are not already in the list */ list_init(&n->hooks); - if (!n->no_builtin) { + if (n->builtin) { int ret; for (size_t i = 0; i < list_length(&plugins); i++) { struct plugin *q = (struct plugin *) list_at(&plugins, i); @@ -117,7 +117,7 @@ int node_parse(struct node *n, json_t *cfg, const char *name) "vectorize", &n->vectorize, "samplelen", &n->samplelen, "hooks", &json_hooks, - "no_builtin", &n->no_builtin, + "builtin", &n->builtin, "signals", &json_signals ); if (ret) diff --git a/lib/path.c b/lib/path.c index d54f4f5cb..c4a512416 100644 --- a/lib/path.c +++ b/lib/path.c @@ -250,6 +250,7 @@ int path_init(struct path *p) p->mode = PATH_MODE_ANY; p->rate = 0; /* Disabled */ + p->builtin = 1; p->reverse = 0; p->enabled = 1; p->queuelen = DEFAULT_QUEUELEN; @@ -257,7 +258,7 @@ int path_init(struct path *p) #ifdef WITH_HOOKS /* Add internal hooks if they are not already in the list */ list_init(&p->hooks); - if (!p->no_builtin) { + if (p->builtin) { int ret; for (size_t i = 0; i < list_length(&plugins); i++) { @@ -403,7 +404,7 @@ int path_parse(struct path *p, json_t *cfg, struct list *nodes) "hooks", &json_hooks, "reverse", &p->reverse, "enabled", &p->enabled, - "no_builtin", &p->no_builtin, + "builtin", &p->builtin, "queuelen", &p->queuelen, "mode", &mode, "rate", &p->rate,