mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
make use of timestamps in send/receive tools configurable via TOOLS_USE_TIMESTAMP (config.h)
This commit is contained in:
parent
482be0ebbb
commit
9e0153f0f8
3 changed files with 6 additions and 3 deletions
|
@ -34,6 +34,8 @@
|
|||
#define IPPROTO_S2SS 137
|
||||
#define ETH_P_S2SS 0xBABE
|
||||
|
||||
#define TOOLS_USE_TIMESTAMP 1
|
||||
|
||||
/* Hook function configuration */
|
||||
#define HOOK_FIR_INDEX 1 /**< The first value of message should be filtered. */
|
||||
#define HOOK_TS_INDEX -1 /**< The last value of message should be overwritten by a timestamp. */
|
||||
|
|
|
@ -100,12 +100,13 @@ int main(int argc, char *argv[])
|
|||
node_reverse(node);
|
||||
|
||||
node->refcnt++;
|
||||
pool = alloc(sizeof(struct msg) * node->combine);
|
||||
|
||||
node_init(argc-optind, argv+optind, &set);
|
||||
node_start(node);
|
||||
node_start_defer(node);
|
||||
|
||||
pool = alloc(sizeof(struct msg) * node->combine);
|
||||
|
||||
/* Print header */
|
||||
fprintf(stderr, "# %-6s %-8s %-12s\n", "dev_id", "seq_no", "data");
|
||||
|
||||
|
@ -116,7 +117,7 @@ int main(int argc, char *argv[])
|
|||
if (msg_verify(&pool[i]))
|
||||
warn("Failed to verify message");
|
||||
|
||||
#if 1
|
||||
#if TOOLS_USE_TIMESTAMP
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
fprintf(stdout, "%17.6f\t", ts.tv_sec + ts.tv_nsec / 1e9);
|
||||
|
|
|
@ -111,7 +111,7 @@ int main(int argc, char *argv[])
|
|||
for (int i=0; i<node->combine; i++) {
|
||||
msg_fscan(stdin, &pool[i]);
|
||||
|
||||
#if 1 /* Preprend timestamp */
|
||||
#if TOOLS_USE_TIMESTAMP
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
fprintf(stdout, "%17.6f\t", ts.tv_sec + ts.tv_nsec / 1e9);
|
||||
|
|
Loading…
Add table
Reference in a new issue