-LttEvent *ltt_event_new();
-
-void ltt_event_destroy(LttEvent *event);
-
-/* Events and their content, including the raw data, are only valid
- until reading another event from the same tracefile.
- Indeed, since event reading is critical to the performance,
- the memory associated with an event may be reused at each read. */
-
-/* Obtain the trace unique integer id associated with the type of
- this event */
-
-unsigned ltt_event_eventtype_id(const LttEvent *e);
-
-unsigned ltt_event_facility_id(const LttEvent *e);
-
-/* Facility and type for the event */
-
-LttFacility *ltt_event_facility(const LttEvent *e);
-
-LttEventType *ltt_event_eventtype(const LttEvent *e);
-
-
-/* Root field for the event */
-
-LttField *ltt_event_field(LttEvent *e);
-
-
-/* Time and cycle count for the event */
-
-LttTime ltt_event_time(const LttEvent *e);
-
-LttCycleCount ltt_event_cycle_count(const LttEvent *e);
-
+/*
+ * Structure LttEvent and LttEventPosition must begin with the _exact_ same
+ * fields in the exact same order. LttEventPosition is a parent of LttEvent.
+ */
+struct LttEvent {
+ /* Begin of LttEventPosition fields */
+ LttTracefile *tracefile;
+ unsigned int block;
+ unsigned int offset;
+
+ /* Timekeeping */
+ uint64_t tsc; /* Current timestamp counter */
+
+ /* End of LttEventPosition fields */
+ guint32 timestamp; /* truncated timestamp */
+
+ guint16 event_id;
+
+ LttTime event_time;
+
+ void *data; /* event data */
+ guint data_size;
+ guint event_size; /* event_size field of the header :
+ used to verify data_size from facility. */
+ uint32_t compact_data;
+
+ int count; /* the number of overflow of cycle count */
+ gint64 overflow_nsec; /* precalculated nsec for overflows */
+};
+
+struct LttEventPosition {
+ LttTracefile *tracefile;
+ unsigned int block;
+ unsigned int offset;
+
+ /* Timekeeping */
+ uint64_t tsc; /* Current timestamp counter */
+};
+
+static inline guint16 ltt_event_id(struct LttEvent *event)
+{
+ return event->event_id;
+}
+
+static inline LttTime ltt_event_time(struct LttEvent *event)
+{
+ return event->event_time;
+}