fix state computation so it put max time computed in seek to end of trace time value...
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 31 Aug 2005 17:36:04 +0000 (17:36 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 31 Aug 2005 17:36:04 +0000 (17:36 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1098 04897980-b3bd-0310-b5e0-8ef037075253

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

index c06ba340e25fa77d7bfc97002f3e2de001f8c070..5c1452cb30f95e828cc87b55f05fabc77f875795 100644 (file)
@@ -1597,6 +1597,15 @@ static gboolean state_save_event_hook(void *hook_data, void *call_data)
   return FALSE;
 }
 
+static gboolean state_save_after_trace_hook(void *hook_data, void *call_data)
+{
+  LttvTraceState *tcs = (LttvTraceState *)(call_data);
+  
+  *(tcs->max_time_state_recomputed_in_seek) = tcs->parent.time_span.end_time;
+
+  return FALSE;
+}
+
 #if 0
 static gboolean block_start(void *hook_data, void *call_data)
 {
@@ -1745,6 +1754,10 @@ void lttv_state_save_add_event_hooks(LttvTracesetState *self)
 
     }
   }
+  
+  lttv_process_traceset_begin(&self->parent,
+                NULL, NULL, NULL, NULL, NULL);
+  
 }
 
 gint lttv_state_save_hook_add_event_hooks(void *hook_data, void *call_data)
@@ -1805,7 +1818,19 @@ void lttv_state_save_remove_event_hooks(LttvTracesetState *self)
 
   LttvTracefileState *tfs;
 
+  LttvHooks *after_trace = lttv_hooks_new();
+  
+  lttv_hooks_add(after_trace,
+                 state_save_after_trace_hook,
+                 NULL,
+                 LTTV_PRIO_STATE);
+
+  
+  lttv_process_traceset_end(&self->parent,
+                NULL, after_trace, NULL, NULL, NULL);
  
+  lttv_hooks_destroy(after_trace);
+  
   nb_trace = lttv_traceset_number(traceset);
   for(i = 0 ; i < nb_trace ; i++) {
 
@@ -1820,7 +1845,6 @@ 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);
   }
index 5e7ad28292f2310d6d61de14931caffa63af5ba6..7d560557654a2a239ff5fbbbad4a643d93c3f990 100644 (file)
@@ -134,6 +134,8 @@ static void lttv_traceset_context_compute_time_span(
     trace = tc->t;
 
     ltt_trace_time_span_get(trace, &s, &e);
+    tc->time_span.start_time = s;
+    tc->time_span.end_time = e;
 
     if(i==0){
       time_span->start_time = s;
index 714c0a18c9f6f9a2b74c4843448273e37e0f02ba..c200ff5156c18b21f75d57e922bbb5311470c9b5 100644 (file)
@@ -147,6 +147,7 @@ struct _LttvTraceContext {
   GArray *tracefiles;
   LttvAttribute *a;
   LttvAttribute *t_a;
+  TimeInterval time_span;
 };
 
 struct _LttvTraceContextClass {
This page took 0.031963 seconds and 4 git commands to generate.