From: compudj Date: Sat, 15 May 2004 13:59:46 +0000 (+0000) Subject: pending request fixed X-Git-Tag: v0.12.20~2962 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=8f2872f471af70732f1a490c24904292b668dd03;hp=05a85b91d1563bd5385a15751cbac2085d006959;p=lttv.git pending request fixed git-svn-id: http://ltt.polymtl.ca/svn@527 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c index 58d679c3..72a6f9d7 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c @@ -379,6 +379,8 @@ unsigned get_max_event_number(MainWindow * mw_data) * process_traceset, then display all viewers of * the current tab * It will then remove all entries from the time_requests array. + * CHECK : we give more events than requested to the viewers. They + * Have to filter them by themselves. */ gint compare_time_request(TimeRequest *a, TimeRequest *b) @@ -447,12 +449,31 @@ void call_pending_read_hooks(MainWindow * mw_data) LttTime end_time = ltt_time_add( time_request->time_window.start_time, time_request->time_window.time_width); - if(i == 0 || !(ltt_time_compare(time_request->time_window.start_time, ltt_event_time(tsc->e))<0) )//FIXME This comparison makes no sense (the author) :) + if(i == 0 || !(ltt_time_compare(time_request->time_window.start_time, ltt_event_time(tsc->e))<0) ) { /* do it if first request or start_time >= last event's time */ lttv_process_traceset_seek_time(tsc, time_request->time_window.start_time); lttv_process_traceset(tsc, end_time, time_request->num_events); } + else + { + if(ltt_time_compare(time_request->time_window.start_time, ltt_event_time(tsc->e))<0 + && !(ltt_time_compare(end_time, ltt_event_time(tsc->e))<0)) + { + /* Continue reading from current event */ + lttv_process_traceset(tsc, end_time, time_request->num_events); + + } + else + { + if(ltt_time_compare(time_request->time_window.start_time, end_time) > 0) + { + /* This is a request for a minimum number of events, give + * more events than necessary */ + lttv_process_traceset(tsc, end_time, time_request->num_events); + } + } + } /* Call the end of process_traceset hook */ lttv_hooks_add(tmp_hooks,