From e37c1372645a505468f33a563a076502f36930c2 Mon Sep 17 00:00:00 2001 From: yangxx Date: Wed, 24 Sep 2003 19:07:51 +0000 Subject: [PATCH] git-svn-id: http://ltt.polymtl.ca/svn@243 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/include/ltt/ltt-private.h | 1 + ltt/branches/poly/ltt/tracefile.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ltt/branches/poly/include/ltt/ltt-private.h b/ltt/branches/poly/include/ltt/ltt-private.h index 62f2383a..c516bb49 100644 --- a/ltt/branches/poly/include/ltt/ltt-private.h +++ b/ltt/branches/poly/include/ltt/ltt-private.h @@ -135,6 +135,7 @@ struct _LttTracefile{ double cycle_per_nsec; //Cycles per nsec unsigned cur_heart_beat_number; //current number of heart beat in the buf LttCycleCount cur_cycle_count; //current cycle count of the event + void * last_event_pos; LttTime prev_block_end_time; //the end time of previous block LttTime prev_event_time; //the time of the previous event 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; -- 2.34.1