send time in events

this calls clock_gettime for each active T macro, hopefully it
does not eat too much CPU

can be deactivated by commenting one line in T_defs.h
This commit is contained in:
Cedric Roux
2016-05-11 18:26:30 +02:00
parent 3e38cd2651
commit aacb2ff7c2
3 changed files with 33 additions and 0 deletions
+5
View File
@@ -84,10 +84,15 @@ int fullread(int fd, void *_buf, int count)
event get_event(int s, char *v, void *d)
{
struct timespec t;
int type;
int32_t length;
fullread(s, &length, 4);
#ifdef T_SEND_TIME
fullread(s, &t, sizeof(struct timespec));
length -= sizeof(struct timespec);
#endif
fullread(s, &type, sizeof(int));
length -= sizeof(int);
fullread(s, v, length);