From: yangxx Date: Fri, 25 Jul 2003 15:31:49 +0000 (+0000) Subject: git-svn-id: http://ltt.polymtl.ca/svn@142 04897980-b3bd-0310-b5e0-8ef037075253 X-Git-Tag: v0.12.20~3347 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1a3b8cbdda58cf6f92a17751d5a4929c07515702;p=lttv.git git-svn-id: ltt.polymtl.ca/svn@142 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 928f541a..d4a47067 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -728,15 +728,17 @@ void ltt_tracefile_seek_time(LttTracefile *t, LttTime time) return ltt_tracefile_seek_time(t, time); } }else if(err < 0){ - err = t->which_block; - ev = ltt_tracefile_read(t); - if(ev == NULL){ - g_print("End of file\n"); - return; + while(1){ + ev = ltt_tracefile_read(t); + if(ev == NULL){ + g_print("End of file\n"); + return; + } + g_free(ev); + lttTime = getEventTime(t); + err = timecmp(<tTime, &time); + if(err >= 0)return; } - g_free(ev); - if(t->which_block == err) - return ltt_tracefile_seek_time(t,time); }else return; }else if(headTime > 0){ if(t->which_block == 1){ @@ -762,7 +764,7 @@ void ltt_tracefile_seek_time(LttTracefile *t, LttTime time) }else if(headTime == 0){ updateTracefile(t); }else if(tailTime == 0){ - t->cur_event_pos = t->a_block_end; + t->cur_event_pos = t->a_block_end - EVENT_HEADER_SIZE; t->current_event_time = time; t->cur_heart_beat_number = 0; t->prev_event_time.tv_sec = 0;