mega fix for states : per cpu and _not_ per tracefile state. We have many tracefiles...
[lttv.git] / ltt / branches / poly / lttv / lttv / tracecontext.c
index 1084ad60632acb75314a517a5647a6e37cf5edd5..be0f8d9dc28b2310321d48e0e32f68931ca97df5 100644 (file)
@@ -808,7 +808,10 @@ void lttv_process_traceset_end(LttvTracesetContext *self,
 
 /* Subtile modification : 
  * if tracefile has no event at or after the time requested, it is not put in
- * the queue, as the next read would fail. */
+ * the queue, as the next read would fail.
+ *
+ * Don't forget to empty the traceset pqueue before calling this.
+ */
 void lttv_process_trace_seek_time(LttvTraceContext *self, LttTime start)
 {
   guint i, nb_tracefile;
@@ -819,9 +822,6 @@ void lttv_process_trace_seek_time(LttvTraceContext *self, LttTime start)
 
   nb_tracefile = self->tracefiles->len;
 
-  g_tree_destroy(self->ts_context->pqueue);
-  self->ts_context->pqueue = g_tree_new(compare_tracefile);
-
   GTree *pqueue = self->ts_context->pqueue;
 
   for(i = 0 ; i < nb_tracefile ; i++) {
@@ -858,6 +858,9 @@ void lttv_process_traceset_seek_time(LttvTracesetContext *self, LttTime start)
 
   LttvTraceContext *tc;
 
+  g_tree_destroy(self->pqueue);
+  self->pqueue = g_tree_new(compare_tracefile);
+
   nb_trace = lttv_traceset_number(self->ts);
   for(i = 0 ; i < nb_trace ; i++) {
     tc = self->traces[i];
This page took 0.022769 seconds and 4 git commands to generate.