X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fevent.c;h=46333ffbb4fb50df99703e1f69dfcfc3322ad806;hb=ae4e77e0a98448e785288290c9d786d65e8e039b;hp=ad7e6c33366fb0e822b8dd2e19993cd1ece75b9e;hpb=a2331fa0f3390c29cee40007f69f14fa1d216707;p=lttv.git diff --git a/ltt/branches/poly/ltt/event.c b/ltt/branches/poly/ltt/event.c index ad7e6c33..46333ffb 100644 --- a/ltt/branches/poly/ltt/event.c +++ b/ltt/branches/poly/ltt/event.c @@ -181,6 +181,59 @@ 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 = FALSE; + ep->event_offset = e->data - e->tracefile->buffer - EVENT_HEADER_SIZE ; + ep->tf = e->tracefile; +} + +/***************************************************************************** + *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, LttTracefile ** tf) +{ + *block_number = ep->block_num; + *index_in_block = ep->event_num; + *tf = ep->tf; +} + +/***************************************************************************** + *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