14 * Structure LttEvent and LttEventPosition must begin with the _exact_ same
15 * fields in the exact same order. LttEventPosition is a parent of LttEvent.
18 /* Begin of LttEventPosition fields */
19 LttTracefile
*tracefile
;
24 uint64_t tsc
; /* Current timestamp counter */
26 /* End of LttEventPosition fields */
27 guint32 timestamp
; /* truncated timestamp */
33 void *data
; /* event data */
35 guint event_size
; /* event_size field of the header :
36 used to verify data_size from facility. */
37 uint32_t compact_data
;
39 int count
; /* the number of overflow of cycle count */
40 gint64 overflow_nsec
; /* precalculated nsec for overflows */
43 struct LttEventPosition
{
44 LttTracefile
*tracefile
;
49 uint64_t tsc
; /* Current timestamp counter */
52 static inline guint16
ltt_event_id(struct LttEvent
*event
)
54 return event
->event_id
;
57 static inline LttTime
ltt_event_time(struct LttEvent
*event
)
59 return event
->event_time
;
62 /* Obtain the position of the event within the tracefile. This
63 is used to seek back to this position later or to seek to another
64 position, computed relative to this position. The event position
65 structure is opaque and contains several fields, only two
66 of which are user accessible: block number and event index
69 void ltt_event_position(LttEvent
*e
, LttEventPosition
*ep
);
71 LttEventPosition
* ltt_event_position_new();
73 void ltt_event_position_get(LttEventPosition
*ep
, LttTracefile
**tf
,
74 guint
*block
, guint
*offset
, guint64
*tsc
);
76 void ltt_event_position_set(LttEventPosition
*ep
, LttTracefile
*tf
,
77 guint block
, guint offset
, guint64 tsc
);
79 gint
ltt_event_position_compare(const LttEventPosition
*ep1
,
80 const LttEventPosition
*ep2
);
82 void ltt_event_position_copy(LttEventPosition
*dest
,
83 const LttEventPosition
*src
);
85 LttTracefile
*ltt_event_position_tracefile(LttEventPosition
*ep
);
87 /* These functions extract data from an event after architecture specific
90 guint32
ltt_event_get_unsigned(LttEvent
*e
, struct marker_field
*f
);
92 gint32
ltt_event_get_int(LttEvent
*e
, struct marker_field
*f
);
94 guint64
ltt_event_get_long_unsigned(LttEvent
*e
, struct marker_field
*f
);
96 gint64
ltt_event_get_long_int(LttEvent
*e
, struct marker_field
*f
);
98 float ltt_event_get_float(LttEvent
*e
, struct marker_field
*f
);
100 double ltt_event_get_double(LttEvent
*e
, struct marker_field
*f
);
103 /* The string obtained is only valid until the next read from
104 * the same tracefile. */
106 gchar
*ltt_event_get_string(LttEvent
*e
, struct marker_field
*f
);
108 static inline LttCycleCount
ltt_event_cycle_count(const LttEvent
*e
)
113 #endif //_LTT_EVENT_H
This page took 0.033094 seconds and 4 git commands to generate.