mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
move 'samplelen' setting from per path to per node configuration
This commit is contained in:
parent
821a8e1fa5
commit
e7666be1ef
6 changed files with 8 additions and 15 deletions
|
@ -41,7 +41,6 @@ struct sample;
|
|||
*/
|
||||
struct loopback {
|
||||
int queuelen;
|
||||
int samplelen;
|
||||
|
||||
struct queue_signalled queue;
|
||||
struct pool pool;
|
||||
|
|
|
@ -79,7 +79,6 @@ struct path {
|
|||
int enabled; /**< Is this path enabled. */
|
||||
int reverse; /**< This path as a matching reverse path. */
|
||||
|
||||
int samplelen;
|
||||
int queuelen;
|
||||
int sequence;
|
||||
|
||||
|
|
|
@ -268,7 +268,7 @@ char * node_name_long(struct node *n)
|
|||
if (n->_vt->print) {
|
||||
struct node_type *vt = n->_vt;
|
||||
char *name_long = vt->print(n);
|
||||
strcatf(&n->_name_long, "%s: vectorize=%d, %s", node_name(n), n->vectorize, name_long);
|
||||
strcatf(&n->_name_long, "%s: id=%d, vectorize=%d, samplelen=%d, %s", node_name(n), n->id, n->vectorize, n->samplelen, name_long);
|
||||
free(name_long);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -36,11 +36,9 @@ int loopback_parse(struct node *n, json_t *cfg)
|
|||
|
||||
/* Default values */
|
||||
l->queuelen = DEFAULT_QUEUELEN;
|
||||
l->samplelen = DEFAULT_SAMPLELEN;
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: i, s?: i }",
|
||||
"queuelen", &l->queuelen,
|
||||
"samplelen", &l->samplelen
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: i }",
|
||||
"queuelen", &l->queuelen
|
||||
);
|
||||
if (ret)
|
||||
jerror(&err, "Failed to parse configuration of node %s", node_name(n));
|
||||
|
@ -53,7 +51,7 @@ int loopback_open(struct node *n)
|
|||
int ret;
|
||||
struct loopback *l = n->_vd;
|
||||
|
||||
ret = pool_init(&l->pool, l->queuelen, SAMPLE_LEN(l->samplelen), &memtype_hugepage);
|
||||
ret = pool_init(&l->pool, l->queuelen, SAMPLE_LEN(n->samplelen), &memtype_hugepage);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
|
@ -47,15 +47,14 @@ int shmem_parse(struct node *n, json_t *cfg)
|
|||
|
||||
/* Default values */
|
||||
shm->conf.queuelen = MAX(DEFAULT_SHMEM_QUEUELEN, n->vectorize);
|
||||
shm->conf.samplelen = DEFAULT_SHMEM_SAMPLELEN;
|
||||
shm->conf.samplelen = n->samplelen;
|
||||
shm->conf.polling = false;
|
||||
shm->exec = NULL;
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s: s, s: s, s?: i, s?: i, s?: b, s?: o }",
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s: s, s: s, s?: i, s?: b, s?: o }",
|
||||
"out_name", &shm->out_name,
|
||||
"in_name", &shm->in_name,
|
||||
"queuelen", &shm->conf.queuelen,
|
||||
"samplelen", &shm->conf.samplelen,
|
||||
"polling", &shm->conf.polling,
|
||||
"exec", &cfg_exec
|
||||
);
|
||||
|
@ -173,8 +172,8 @@ char * shmem_print(struct node *n)
|
|||
struct shmem *shm = n->_vd;
|
||||
char *buf = NULL;
|
||||
|
||||
strcatf(&buf, "out_name=%s, in_name=%s, queuelen=%d, samplelen=%d, polling=%s",
|
||||
shm->out_name, shm->in_name, shm->conf.queuelen, shm->conf.samplelen, shm->conf.polling ? "yes" : "no");
|
||||
strcatf(&buf, "out_name=%s, in_name=%s, queuelen=%d, polling=%s",
|
||||
shm->out_name, shm->in_name, shm->conf.queuelen, shm->conf.polling ? "yes" : "no");
|
||||
|
||||
if (shm->exec) {
|
||||
strcatf(&buf, ", exec='");
|
||||
|
|
|
@ -209,7 +209,6 @@ int path_init(struct path *p, struct super_node *sn)
|
|||
p->reverse = 0;
|
||||
p->enabled = 1;
|
||||
|
||||
p->samplelen = DEFAULT_SAMPLELEN;
|
||||
p->queuelen = DEFAULT_QUEUELEN;
|
||||
|
||||
p->super_node = sn;
|
||||
|
@ -311,7 +310,6 @@ int path_parse(struct path *p, json_t *cfg, struct list *nodes)
|
|||
"hooks", &json_hooks,
|
||||
"reverse", &p->reverse,
|
||||
"enabled", &p->enabled,
|
||||
"samplelen", &p->samplelen,
|
||||
"queuelen", &p->queuelen
|
||||
);
|
||||
if (ret)
|
||||
|
|
Loading…
Add table
Reference in a new issue