X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Flttv%2Fsync%2Fdata_structures.h;h=5f5e4be373a5344a6dd7477bc57e1d83343cf54e;hb=ffa21cfde7a086c1558b961ffa0fcbe75513a7f6;hp=719f664d2ce8b6c4dadf62917cf5a6b5790d487d;hpb=2bd4b3e43e525da7b4c9738915ec847f7fe4906a;p=lttv.git diff --git a/lttv/lttv/sync/data_structures.h b/lttv/lttv/sync/data_structures.h index 719f664d..5f5e4be3 100644 --- a/lttv/lttv/sync/data_structures.h +++ b/lttv/lttv/sync/data_structures.h @@ -23,8 +23,6 @@ #include #include -#include - enum Direction { @@ -79,10 +77,17 @@ typedef struct bool unicast; } UDPEvent; +typedef struct +{ + uint32_t seconds; + uint32_t nanosec; +} WallTime; + typedef struct _Event { unsigned long traceNum; - uint64_t time; + uint64_t cpuTime; + WallTime wallTime; // specific event structures and functions could be in separate files and // type could be an int @@ -93,6 +98,7 @@ typedef struct _Event UDPEvent* udpEvent; } event; + void (*copy)(const struct _Event* const event, struct _Event** const newEvent); void (*destroy)(struct _Event* const event); } Event; @@ -107,11 +113,13 @@ typedef struct _Message typedef struct { Message* message; + // Event* acks[] GQueue* acks; } Exchange; typedef struct { + // Event* events[] GQueue* events; } Broadcast; @@ -142,10 +150,14 @@ void gdnDestroyDatagramKey(gpointer data); // Event-related functions void gdnDestroyEvent(gpointer data); +void copyEvent(const Event* const event, Event** const newEvent); +void copyTCPEvent(const Event* const event, Event** const newEvent); +void copyUDPEvent(const Event* const event, Event** const newEvent); void destroyEvent(Event* const event); void destroyTCPEvent(Event* const event); void destroyUDPEvent(Event* const event); void gfDestroyEvent(gpointer data, gpointer user_data); +double wallTimeSub(const WallTime const* tA, const WallTime const* tB); // Message-related functions void printTCPSegment(const Message* const segment);