X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fevent.c;h=7ef6737728bbba7cbeebd9ee8cc58f81205fd019;hb=80da81adfa88158bd3d4c26f89f96f8b58c77b4f;hp=ad7e6c33366fb0e822b8dd2e19993cd1ece75b9e;hpb=01a5c7e14a0f0fe5ad4a1256376252bcb53808a7;p=lttv.git diff --git a/ltt/branches/poly/ltt/event.c b/ltt/branches/poly/ltt/event.c index ad7e6c33..7ef67377 100644 --- a/ltt/branches/poly/ltt/event.c +++ b/ltt/branches/poly/ltt/event.c @@ -181,6 +181,57 @@ LttCycleCount ltt_event_cycle_count(LttEvent *e) return e->event_cycle_count; } +/***************************************************************************** + *Function name + * ltt_event_position : get the event's position + *Input params + * e : an instance of an event type + * ep : a pointer to event's position structure + ****************************************************************************/ + +void ltt_event_position(LttEvent *e, LttEventPosition *ep) +{ + ep->block_num = e->which_block; + ep->event_num = e->which_event; + ep->event_time = e->event_time; + ep->event_cycle_count = e->event_cycle_count; + ep->heart_beat_number = e->tracefile->cur_heart_beat_number; + ep->old_position = TRUE; + ep->event_offset = e->data - e->tracefile->buffer - EVENT_HEADER_SIZE ; +} + +/***************************************************************************** + *Function name + * ltt_event_position_get : get the block number and index of the event + *Input params + * ep : a pointer to event's position structure + * block_number : the block number of the event + * index_in_block : the index of the event within the block + ****************************************************************************/ + +void ltt_event_position_get(LttEventPosition *ep, + unsigned *block_number, unsigned *index_in_block) +{ + *block_number = ep->block_num; + *index_in_block = ep->event_num; +} + +/***************************************************************************** + *Function name + * ltt_event_position_set : set the block number and index of the event + *Input params + * ep : a pointer to event's position structure + * block_number : the block number of the event + * index_in_block : the index of the event within the block + ****************************************************************************/ + +void ltt_event_position_set(LttEventPosition *ep, + unsigned block_number, unsigned index_in_block) +{ + ep->block_num = block_number; + ep->event_num = index_in_block; +} + /***************************************************************************** *Function name * ltt_event_cpu_i: get the cpu id where the event happens