1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

replace clock_gettime() by time_now()

This commit is contained in:
Steffen Vogel 2015-10-12 16:25:08 +02:00
parent 51db785bfd
commit 24fa12c369
5 changed files with 8 additions and 11 deletions

View file

@ -254,7 +254,7 @@ int hook_skip_first(struct path *p, struct hook *h, int when)
break;
case HOOK_PATH_START:
clock_gettime(CLOCK_REALTIME, &private->started);
private->started = time_now();
break;
case HOOK_POST: {

View file

@ -56,7 +56,7 @@ void log_setlevel(int lvl)
void log_init()
{
clock_gettime(CLOCK_REALTIME, &epoch);
epoch = time_now();
debug(10, "Debug clock resetted");
}
@ -71,11 +71,10 @@ void log_print(const char *lvl, const char *fmt, ...)
void log_vprint(const char *lvl, const char *fmt, va_list ap)
{
struct timespec ts;
struct timespec ts = time_now();
char *buf = alloc(512);
/* Timestamp */
clock_gettime(CLOCK_REALTIME, &ts);
strcatf(&buf, "%10.3f ", time_delta(&epoch, &ts));
/* Severity */

View file

@ -35,7 +35,7 @@ static void path_write(struct path *p)
debug(15, "Sent %u messages to node '%s'", sent, n->name);
p->sent += sent;
clock_gettime(CLOCK_REALTIME, &p->ts_sent);
p->ts_sent = time_now(); /** @todo use hardware timestamps for socket node type */
}
}
@ -93,8 +93,8 @@ static void * path_run(void *arg)
continue;
/** @todo Replace this timestamp by hardware timestamping */
clock_gettime(CLOCK_REALTIME, &p->ts_recv);
p->ts_recv = time_now();
debug(15, "Received %u messages from node '%s'", recv, p->in->name);
/* Run preprocessing hooks */

View file

@ -59,8 +59,7 @@ int main(int argc, char *argv[])
while (limit-- > 0 || argc < 4) {
m.sequence += timerfd_wait(tfd);
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
struct timespec ts = time_now();
m.ts.sec = ts.tv_sec;
m.ts.nsec = ts.tv_nsec;

View file

@ -113,8 +113,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "# %-20s\t\t%s\n", "sec.nsec+offset(seq)", "data[]");
for (;;) {
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
struct timespec ts = time_now();
int recv = node_read(node, pool, node->combine, 0, node->combine);
for (int i = 0; i < recv; i++) {