seek position fixed for state
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 25 Aug 2005 18:33:16 +0000 (18:33 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 25 Aug 2005 18:33:16 +0000 (18:33 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1078 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/state.c
ltt/branches/poly/lttv/lttv/tracecontext.c

index 6ee5e32e1dc9d04a7cdbfbb0ad521e53789dd8ff..b107c25b40554c7e5d17a9f3f1052622f290d69a 100644 (file)
@@ -438,8 +438,10 @@ static void state_save(LttvTraceState *self, LttvAttribute *container)
     *(value.v_uint) = tfcs->process->pid;
     value = lttv_attribute_add(tracefile_tree, LTTV_STATE_EVENT, 
         LTTV_POINTER);
-    /* Only save the position of the tfs is in the pqueue */
-    if(!g_tree_lookup(self->parent.ts_context->pqueue, &tfcs->parent)) {
+    /* Only save the position if the tfs has not infinite time. */
+    //if(!g_tree_lookup(self->parent.ts_context->pqueue, &tfcs->parent)
+    //    && current_tfcs != tfcs) {
+    if(ltt_time_compare(tfcs->parent.timestamp, ltt_time_infinite) == 0) {
       *(value.v_pointer) = NULL;
     } else {
       LttEvent *e = ltt_tracefile_get_event(tfcs->parent.tf);
@@ -1549,9 +1551,10 @@ void lttv_state_save_add_event_hooks(LttvTracesetState *self)
     ts = (LttvTraceState *)self->parent.traces[i];
     nb_tracefile = ts->parent.tracefiles->len;
 
+    guint *event_count = g_new(guint, 1);
+    *event_count = 0;
+
     for(j = 0 ; j < nb_tracefile ; j++) {
-      guint *event_count = g_new(guint, 1);
-      *event_count = 0;
       tfs = 
           LTTV_TRACEFILE_STATE(g_array_index(ts->parent.tracefiles,
                                           LttvTracefileContext*, j));
@@ -1637,9 +1640,9 @@ void lttv_state_save_remove_event_hooks(LttvTracesetState *self)
                                           LttvTracefileContext*, j));
       event_count = lttv_hooks_remove(tfs->parent.event,
                         state_save_event_hook);
-      g_free(event_count);
 
     }
+    g_free(event_count);
   }
 }
 
index fca7dacced0833b678476e9cf3b0565ee82e83dc..1084ad60632acb75314a517a5647a6e37cf5edd5 100644 (file)
@@ -764,7 +764,7 @@ guint lttv_process_traceset_middle(LttvTracesetContext *self,
     read_ret = ltt_tracefile_read(tfc->tf);
 
     if(likely(!read_ret)) {
-      g_debug("An event is ready");
+      //g_debug("An event is ready");
       tfc->timestamp = ltt_event_time(e);
       g_assert(ltt_time_compare(tfc->timestamp, ltt_time_infinite) != 0);
            g_tree_insert(pqueue, tfc, tfc);
@@ -1066,7 +1066,7 @@ LttvTracesetContextPosition *lttv_traceset_context_position_new()
   return pos;
 }
 
-/* Save all positions, the ones not in the pqueue will have NULL
+/* Save all positions, the ones with infinite time will have NULL
  * ep. */
 void lttv_traceset_context_position_save(const LttvTracesetContext *self,
                                     LttvTracesetContextPosition *pos)
This page took 0.026566 seconds and 4 git commands to generate.