From 15e7e78e04a8b5e1d96c71164600ff69863817f9 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 7 Nov 2016 22:20:09 -0500 Subject: [PATCH] mark samples with source node --- include/villas/sample.h | 1 + lib/node.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/villas/sample.h b/include/villas/sample.h index 4caf3f927..53230a7cf 100644 --- a/include/villas/sample.h +++ b/include/villas/sample.h @@ -45,6 +45,7 @@ struct sample { atomic_int refcnt; /**< Reference counter. */ struct pool *pool; /**< This sample is belong to this memory pool. */ + struct node *source; /**< The node from which this sample originates. */ /** All timestamps are seconds / nano seconds after 1.1.1970 UTC */ struct { diff --git a/lib/node.c b/lib/node.c index b4aa9dc02..9bfe0a4c6 100644 --- a/lib/node.c +++ b/lib/node.c @@ -38,6 +38,9 @@ int node_read(struct node *n, struct sample *smps[], unsigned cnt) nread = n->_vt->read(n, smps, cnt); } + for (int i = 0; i < nread; i++) + smps[i]->source = n; + return nread; }