fix control flow with filter by cpu
[lttv.git] / ltt / branches / poly / lttv / modules / gui / histogram / histoeventhooks.c
index dc37164c8ad6e07dc3d22506ed47145dc7d25ac9..28d83583f0b651b3add57bfa363e4db853555694 100644 (file)
@@ -81,7 +81,7 @@
 #define MAX_PATH_LEN 256
 #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
 //FIXME
-#define TRACE_NUMBER 0
+// fixed #define TRACE_NUMBER 0
 #define EXTRA_ALLOC 1024 // pixels
 
 /* Action to do when background computation completed.
@@ -121,6 +121,7 @@ static void histo_request_background_data(HistoControlFlowData *histocontrol_flo
   gint num_traces = lttv_traceset_number(tsc->ts);
   gint i;
   LttvTrace *trace;
+  LttvTraceState *tstate;
 
   LttvHooks *histo_background_ready_hook = 
     lttv_hooks_new();
@@ -130,8 +131,10 @@ static void histo_request_background_data(HistoControlFlowData *histocontrol_flo
   
   for(i=0;i<num_traces;i++) {
     trace = lttv_traceset_get(tsc->ts, i);
+    tstate = LTTV_TRACE_STATE(tsc->traces[i]);
 
-    if(lttvwindowtraces_get_ready(g_quark_from_string("state"),trace)==FALSE) {
+    if(lttvwindowtraces_get_ready(g_quark_from_string("state"),trace)==FALSE
+        && !tstate->has_precomputed_states) {
 
       if(lttvwindowtraces_get_in_progress(g_quark_from_string("state"),
                                           trace) == FALSE) {
@@ -251,8 +254,8 @@ void histo_request_event( HistoControlFlowData *histocontrol_flow_data, guint x,
  
   // LttvHooksById *histo_event_by_id = lttv_hooks_by_id_new();//if necessary for filter!
   // FIXME : eventually request for more traces 
-  for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++)
-  {   
+  // fixed for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++) {
+  for(i=0;i<nb_trace;i++) {
        //should be in the loop or before? 
        EventsRequest *histo_events_request = g_new(EventsRequest, 1);
        
@@ -338,7 +341,7 @@ int histo_count_event(void *hook_data, void *call_data){
   LttvFilter *histo_filter = histocontrol_flow_data->histo_main_win_filter;
   if(histo_filter != NULL && histo_filter->head != NULL)
     if(!lttv_filter_tree_parse(histo_filter->head,e,tfc->tf,
-          tfc->t_context->t,tfc))
+          tfc->t_context->t,tfc,NULL,NULL))
       return FALSE;
 
   TimeWindow time_window  =  lttvwindow_get_time_window(histocontrol_flow_data->tab);
@@ -1109,6 +1112,9 @@ int histo_after_chunk(void *hook_data, void *call_data)
 
   histoDrawing_t *drawing = histocontrol_flow_data->drawing;
 
+  if(!histocontrol_flow_data->chunk_has_begun) return;
+  histocontrol_flow_data->chunk_has_begun = TRUE;
+
   if(tfc != NULL)
     end_time = LTT_TIME_MIN(tfc->timestamp, events_request->end_time);
   else /* end of traceset, or position now out of request : end */
This page took 0.023908 seconds and 4 git commands to generate.