From db55eaae1f4dde1c5f71ebea93f7d49a2a5a275b Mon Sep 17 00:00:00 2001 From: yangxx Date: Wed, 24 Sep 2003 17:39:19 +0000 Subject: [PATCH] git-svn-id: http://ltt.polymtl.ca/svn@242 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/tracefile.c | 43 +++++++++++++++++-------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 5c45d566..2ffa20be 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -743,27 +743,32 @@ void ltt_tracefile_seek_time(LttTracefile *t, LttTime time) LttEvent * ev; if(headTime < 0 && tailTime > 0){ - lttTime = getEventTime(t); - err = timecmp(<tTime, &time); - if(err > 0){ - if(t->which_event==2 || timecmp(&t->prev_event_time,&time)<0){ - return; - }else{ - updateTracefile(t); - return ltt_tracefile_seek_time(t, time); - } - }else if(err < 0){ - while(1){ - ev = ltt_tracefile_read(t); - if(ev == NULL){ - g_print("End of file\n"); + if(timecmp(&(t->a_block_end->time),&(t->current_event_time)) !=0){ + lttTime = getEventTime(t); + err = timecmp(<tTime, &time); + if(err > 0){ + if(t->which_event==2 || timecmp(&t->prev_event_time,&time)<0){ return; + }else{ + updateTracefile(t); + return ltt_tracefile_seek_time(t, time); } - lttTime = getEventTime(t); - err = timecmp(<tTime, &time); - if(err >= 0)return; - } - }else return; + }else if(err < 0){ + while(1){ + ev = ltt_tracefile_read(t); + if(ev == NULL){ + g_print("End of file\n"); + return; + } + lttTime = getEventTime(t); + err = timecmp(<tTime, &time); + if(err >= 0)return; + } + }else return; + }else{//we are at the end of the block + updateTracefile(t); + return ltt_tracefile_seek_time(t, time); + } }else if(headTime > 0){ if(t->which_block == 1){ updateTracefile(t); -- 2.34.1