10 #include <ltt/marker.h>
13 * Structure LttEvent and LttEventPosition must begin with the _exact_ same
14 * fields in the exact same order. LttEventPosition is a parent of LttEvent.
17 /* Begin of LttEventPosition fields */
18 LttTracefile
*tracefile
;
23 uint64_t tsc
; /* Current timestamp counter */
25 /* End of LttEventPosition fields */
26 guint32 timestamp
; /* truncated timestamp */
32 void *data
; /* event data */
34 guint event_size
; /* event_size field of the header :
35 used to verify data_size from facility. */
36 uint32_t compact_data
;
38 int count
; /* the number of overflow of cycle count */
39 gint64 overflow_nsec
; /* precalculated nsec for overflows */
42 struct LttEventPosition
{
43 LttTracefile
*tracefile
;
48 uint64_t tsc
; /* Current timestamp counter */
51 static inline guint16
ltt_event_id(struct LttEvent
*event
)
53 return event
->event_id
;
56 static inline LttTime
ltt_event_time(struct LttEvent
*event
)
58 return event
->event_time
;
61 /* Obtain the position of the event within the tracefile. This
62 is used to seek back to this position later or to seek to another
63 position, computed relative to this position. The event position
64 structure is opaque and contains several fields, only two
65 of which are user accessible: block number and event index
68 void ltt_event_position(LttEvent
*e
, LttEventPosition
*ep
);
70 LttEventPosition
* ltt_event_position_new();
72 void ltt_event_position_get(LttEventPosition
*ep
, LttTracefile
**tf
,
73 guint
*block
, guint
*offset
, guint64
*tsc
);
75 void ltt_event_position_set(LttEventPosition
*ep
, LttTracefile
*tf
,
76 guint block
, guint offset
, guint64 tsc
);
78 gint
ltt_event_position_compare(const LttEventPosition
*ep1
,
79 const LttEventPosition
*ep2
);
81 void ltt_event_position_copy(LttEventPosition
*dest
,
82 const LttEventPosition
*src
);
84 LttTracefile
*ltt_event_position_tracefile(LttEventPosition
*ep
);
86 /* These functions extract data from an event after architecture specific
89 guint32
ltt_event_get_unsigned(LttEvent
*e
, struct marker_field
*f
);
91 gint32
ltt_event_get_int(LttEvent
*e
, struct marker_field
*f
);
93 guint64
ltt_event_get_long_unsigned(LttEvent
*e
, struct marker_field
*f
);
95 gint64
ltt_event_get_long_int(LttEvent
*e
, struct marker_field
*f
);
97 float ltt_event_get_float(LttEvent
*e
, struct marker_field
*f
);
99 double ltt_event_get_double(LttEvent
*e
, struct marker_field
*f
);
102 /* The string obtained is only valid until the next read from
103 * the same tracefile. */
105 gchar
*ltt_event_get_string(LttEvent
*e
, struct marker_field
*f
);
107 static inline LttCycleCount
ltt_event_cycle_count(const LttEvent
*e
)
112 #endif //_LTT_EVENT_H
This page took 0.031964 seconds and 4 git commands to generate.