From: compudj Date: Wed, 26 May 2004 19:19:40 +0000 (+0000) Subject: end of traceset checked, plus changed case of time_span X-Git-Tag: v0.12.20~2934 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=33f7a12c4cc1fa8117ed1378e0c37ed46dd15142;p=lttv.git end of traceset checked, plus changed case of time_span git-svn-id: http://ltt.polymtl.ca/svn@555 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index d455348f..cffe0b32 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -101,7 +101,7 @@ lttv_context_new_tracefile_context(LttvTracesetContext *self) ***************************************************************************/ static void lttv_traceset_context_compute_time_span( LttvTracesetContext *self, - TimeInterval time_span) + TimeInterval *time_span) { LttvTraceset * traceset = self->ts; int numTraces = lttv_traceset_number(traceset); @@ -110,10 +110,10 @@ static void lttv_traceset_context_compute_time_span( LttvTraceContext *tc; LttTrace * trace; - time_span.startTime.tv_sec = 0; - time_span.startTime.tv_nsec = 0; - time_span.endTime.tv_sec = 0; - time_span.endTime.tv_nsec = 0; + time_span->start_time.tv_sec = 0; + time_span->start_time.tv_nsec = 0; + time_span->end_time.tv_sec = 0; + time_span->end_time.tv_nsec = 0; for(i=0; itraces[i]; @@ -122,17 +122,17 @@ static void lttv_traceset_context_compute_time_span( ltt_trace_time_span_get(trace, &s, &e); if(i==0){ - time_span.startTime = s; - time_span.endTime = e; + time_span->start_time = s; + time_span->end_time = e; }else{ - if(s.tv_sec < time_span.startTime.tv_sec - || (s.tv_sec == time_span.startTime.tv_sec - && s.tv_nsec < time_span.startTime.tv_nsec)) - time_span.startTime = s; - if(e.tv_sec > time_span.endTime.tv_sec - || (e.tv_sec == time_span.endTime.tv_sec - && e.tv_nsec > time_span.endTime.tv_nsec)) - time_span.endTime = e; + if(s.tv_sec < time_span->start_time.tv_sec + || (s.tv_sec == time_span->start_time.tv_sec + && s.tv_nsec < time_span->start_time.tv_nsec)) + time_span->start_time = s; + if(e.tv_sec > time_span->end_time.tv_sec + || (e.tv_sec == time_span->end_time.tv_sec + && e.tv_nsec > time_span->end_time.tv_nsec)) + time_span->end_time = e; } } } @@ -189,7 +189,7 @@ init(LttvTracesetContext *self, LttvTraceset *ts) } } lttv_process_traceset_seek_time(self, null_time); - lttv_traceset_context_compute_time_span(self, self->time_span); + lttv_traceset_context_compute_time_span(self, &self->time_span); self->e = NULL; self->pqueue = g_tree_new(compare_tracefile); @@ -622,6 +622,7 @@ guint lttv_process_traceset_middle(LttvTracesetContext *self, while(TRUE) { tfc = NULL; g_tree_foreach(pqueue, get_first, &tfc); + /* End of traceset : tfc is NULL */ if(tfc == NULL) { self->e = event; @@ -661,10 +662,7 @@ guint lttv_process_traceset_middle(LttvTracesetContext *self, if(event != NULL) { tfc->e = event; tfc->timestamp = ltt_event_time(event); - if(tfc->timestamp.tv_sec < end.tv_sec || - (tfc->timestamp.tv_sec == end.tv_sec && - tfc->timestamp.tv_nsec <= end.tv_nsec)) - g_tree_insert(pqueue, tfc, tfc); + g_tree_insert(pqueue, tfc, tfc); } } }