X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Ftracefile.c;h=1bcc111afde24f76d5eec72eadd1c7df1a01d653;hb=ae4e77e0a98448e785288290c9d786d65e8e039b;hp=2ffa20be0e1f9dda3ad2daf005cdfb1939ec9065;hpb=db55eaae1f4dde1c5f71ebea93f7d49a2a5a275b;p=lttv.git diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 2ffa20be..1bcc111a 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -769,7 +769,7 @@ void ltt_tracefile_seek_time(LttTracefile *t, LttTime time) updateTracefile(t); return ltt_tracefile_seek_time(t, time); } - }else if(headTime > 0){ + }else if(headTime >= 0){ if(t->which_block == 1){ updateTracefile(t); }else{ @@ -790,10 +790,8 @@ void ltt_tracefile_seek_time(LttTracefile *t, LttTime time) return; } if(tailTime < 0) return ltt_tracefile_seek_time(t, time); - }else if(headTime == 0){ - updateTracefile(t); }else if(tailTime == 0){ - t->cur_event_pos = t->a_block_end - EVENT_HEADER_SIZE; + t->cur_event_pos = t->last_event_pos; t->current_event_time = time; t->cur_heart_beat_number = 0; t->prev_event_time.tv_sec = 0; @@ -935,6 +933,7 @@ int readBlock(LttTracefile * tf, int whichBlock) lostSize = *(uint32_t*)(tf->buffer + tf->block_size - sizeof(uint32_t)); tf->a_block_end=(BlockEnd *)(tf->buffer + tf->block_size - lostSize + EVENT_HEADER_SIZE); + tf->last_event_pos = tf->buffer + tf->block_size - lostSize; tf->which_block = whichBlock; tf->which_event = 1;