X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttv%2Flttv%2Fsync%2Fdata_structures.h;h=014b7da105cc8172f836f42e3d21fac8ea49b437;hb=467066eeab8b0a4e5ea07d24f1840310730fd470;hp=765967ffda75d2e018906fc6b9cd5d3d638c55dd;hpb=f6691532b67cb6911749118e3da8d74de876380c;p=lttv.git diff --git a/lttv/lttv/sync/data_structures.h b/lttv/lttv/sync/data_structures.h index 765967ff..014b7da1 100644 --- a/lttv/lttv/sync/data_structures.h +++ b/lttv/lttv/sync/data_structures.h @@ -23,7 +23,19 @@ #include #include -#include + +enum Direction +{ + OUT, + IN, +}; + +enum EventType +{ + TCP, + UDP, + TYPE_COUNT // This must be the last field +}; // Stage 1 to 2: These structures are passed from processing to matching modules // TCP events @@ -43,19 +55,6 @@ typedef struct uint8_t ack, rst, syn, fin; } SegmentKey; -enum Direction -{ - OUT, - IN, -}; - -enum EventType -{ - TCP, - UDP, - TYPE_COUNT, -}; - typedef struct { enum Direction direction; @@ -78,10 +77,19 @@ typedef struct bool unicast; } UDPEvent; +typedef struct +{ + uint32_t seconds; + uint32_t nanosec; +} WallTime; + typedef struct _Event { unsigned long traceNum; - uint64_t time; + // wallTime is corrected according to factors in trace struct, cpuTime + // is not + uint64_t cpuTime; + WallTime wallTime; // specific event structures and functions could be in separate files and // type could be an int @@ -92,6 +100,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; @@ -106,11 +115,13 @@ typedef struct _Message typedef struct { Message* message; + // Event* acks[] GQueue* acks; } Exchange; typedef struct { + // Event* events[] GQueue* events; } Broadcast; @@ -134,12 +145,21 @@ void gdnConnectionKeyDestroy(gpointer data); guint ghfSegmentKeyHash(gconstpointer key); gboolean gefSegmentKeyEqual(gconstpointer a, gconstpointer b); +// DatagramKey-related functions +guint ghfDatagramKeyHash(gconstpointer key); +gboolean gefDatagramKeyEqual(gconstpointer a, gconstpointer b); +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);