TimeWindow now has end_time
[lttv.git] / ltt / branches / poly / lttv / modules / gui / controlflow / eventhooks.c
index a242a96e511d9c4f464468d45edea5cffd472853..197436ef09b70c0e5076010209c33536bf0a365e 100644 (file)
@@ -97,8 +97,7 @@ static void process_add(gpointer key,
   LttTime birth;
   guint y = 0, height = 0, pl_height = 0;
 
-  ProcessList *process_list =
-    guicontrolflow_get_process_list(control_flow_data);
+  ProcessList *process_list = control_flow_data->process_list;
 
   pid = process->pid;
   birth = process->creation_time;
@@ -395,8 +394,7 @@ int before_schedchange_hook(void *hook_data, void *call_data)
   TimeWindow time_window = 
     lttvwindow_get_time_window(control_flow_data->tab);
 
-  LttTime end_time = ltt_time_add(time_window.start_time,
-                                    time_window.time_width);
+  LttTime end_time = time_window.end_time;
 
   if(ltt_time_compare(evtime, time_window.start_time) == -1
         || ltt_time_compare(evtime, end_time) == 1)
@@ -437,8 +435,7 @@ int before_schedchange_hook(void *hook_data, void *call_data)
        /* Add process to process list (if not present) */
       guint y = 0, height = 0, pl_height = 0;
       HashedProcessData *hashed_process_data = NULL;
-      ProcessList *process_list = 
-                      guicontrolflow_get_process_list(control_flow_data);
+      ProcessList *process_list = control_flow_data->process_list;
       LttTime birth = process->creation_time;
       const gchar *name = g_quark_to_string(process->name);
       
@@ -504,6 +501,7 @@ int before_schedchange_hook(void *hook_data, void *call_data)
                            drawing->gc,
                            x,
                            y+(height/2)-3);
+            hashed_process_data->x.middle_marked = TRUE;
           }
           /* jump */
         } else {
@@ -560,8 +558,7 @@ int before_schedchange_hook(void *hook_data, void *call_data)
        /* Add process to process list (if not present) */
       guint y = 0, height = 0, pl_height = 0;
       HashedProcessData *hashed_process_data = NULL;
-      ProcessList *process_list = 
-                      guicontrolflow_get_process_list(control_flow_data);
+      ProcessList *process_list = control_flow_data->process_list;
       LttTime birth = process->creation_time;
       const gchar *name = g_quark_to_string(process->name);
       
@@ -628,6 +625,7 @@ int before_schedchange_hook(void *hook_data, void *call_data)
                            drawing->gc,
                            x,
                            y+(height/2)-3);
+            hashed_process_data->x.middle_marked = TRUE;
           }
           /* jump */
         } else {
@@ -688,8 +686,8 @@ int before_schedchange_hook(void *hook_data, void *call_data)
   TimeWindow time_window = 
     lttvwindow_get_time_window(tab);
 
-  LttTime end_time = ltt_time_add(time_window.start_time,
-                                    time_window.time_width);
+  LttTime end_time = time_window.end_time;
+
   //if(time < time_beg || time > time_end) return;
   if(ltt_time_compare(evtime, time_window.start_time) == -1
         || ltt_time_compare(evtime, end_time) == 1)
@@ -706,8 +704,7 @@ int before_schedchange_hook(void *hook_data, void *call_data)
     LttTime birth;
     guint y_in = 0, y_out = 0, height = 0, pl_height = 0;
 
-    ProcessList *process_list =
-      guicontrolflow_get_process_list(control_flow_data);
+    ProcessList *process_list = control_flow_data->process_list;
 
 
     LttField *f = ltt_event_field(e);
@@ -1310,8 +1307,7 @@ int after_schedchange_hook(void *hook_data, void *call_data)
   TimeWindow time_window = 
     lttvwindow_get_time_window(control_flow_data->tab);
 
-  LttTime end_time = ltt_time_add(time_window.start_time,
-                                    time_window.time_width);
+  LttTime end_time = time_window.end_time;
 
   if(ltt_time_compare(evtime, time_window.start_time) == -1
         || ltt_time_compare(evtime, end_time) == 1)
@@ -1325,8 +1321,7 @@ int after_schedchange_hook(void *hook_data, void *call_data)
   guint y_in = 0, y_out = 0, height = 0, pl_height = 0;
   HashedProcessData *hashed_process_data_in = NULL;
 
-  ProcessList *process_list =
-    guicontrolflow_get_process_list(control_flow_data);
+  ProcessList *process_list = control_flow_data->process_list;
   
   guint pid_in;
   {
@@ -1418,8 +1413,8 @@ int after_schedchange_hook(void *hook_data, void *call_data)
   TimeWindow time_window = 
     lttvwindow_get_time_window(control_flow_data->tab);
 
-  LttTime end_time = ltt_time_add(time_window.start_time,
-                                    time_window.time_width);
+  LttTime end_time = time_window.end_time;
+
   //if(time < time_beg || time > time_end) return;
   if(ltt_time_compare(evtime, time_window.start_time) == -1
         || ltt_time_compare(evtime, end_time) == 1)
@@ -1437,8 +1432,7 @@ int after_schedchange_hook(void *hook_data, void *call_data)
     LttTime birth;
     guint y_in = 0, y_out = 0, height = 0, pl_height = 0;
 
-    ProcessList *process_list =
-      guicontrolflow_get_process_list(control_flow_data);
+    ProcessList *process_list = control_flow_data->process_list;
 
 
     LttField *f = ltt_event_field(e);
@@ -1924,8 +1918,7 @@ int before_execmode_hook(void *hook_data, void *call_data)
   TimeWindow time_window = 
     lttvwindow_get_time_window(control_flow_data->tab);
 
-  LttTime end_time = ltt_time_add(time_window.start_time,
-                                    time_window.time_width);
+  LttTime end_time = time_window.end_time;
 
   if(ltt_time_compare(evtime, time_window.start_time) == -1
         || ltt_time_compare(evtime, end_time) == 1)
@@ -1949,8 +1942,7 @@ int before_execmode_hook(void *hook_data, void *call_data)
    /* Add process to process list (if not present) */
   guint y = 0, height = 0, pl_height = 0;
   HashedProcessData *hashed_process_data = NULL;
-  ProcessList *process_list = 
-                  guicontrolflow_get_process_list(control_flow_data);
+  ProcessList *process_list = control_flow_data->process_list;
   LttTime birth = process->creation_time;
   const gchar *name = g_quark_to_string(process->name);
   
@@ -2017,6 +2009,7 @@ int before_execmode_hook(void *hook_data, void *call_data)
                        drawing->gc,
                        x,
                        y+(height/2)-3);
+        hashed_process_data->x.middle_marked = TRUE;
       }
       /* jump */
     } else {
@@ -2084,8 +2077,7 @@ int after_execmode_hook(void *hook_data, void *call_data)
   TimeWindow time_window = 
     lttvwindow_get_time_window(control_flow_data->tab);
 
-  LttTime end_time = ltt_time_add(time_window.start_time,
-                                    time_window.time_width);
+  LttTime end_time = time_window.end_time;
 
   if(ltt_time_compare(evtime, time_window.start_time) == -1
         || ltt_time_compare(evtime, end_time) == 1)
@@ -2099,9 +2091,7 @@ int after_execmode_hook(void *hook_data, void *call_data)
   guint y = 0, height = 0, pl_height = 0;
   HashedProcessData *hashed_process_data = NULL;
 
-  ProcessList *process_list =
-    guicontrolflow_get_process_list(control_flow_data);
-  
+  ProcessList *process_list = control_flow_data->process_list;
 
   /* Find process pid_in in the list... */
   process = tfs->process;
@@ -2192,8 +2182,7 @@ int before_process_hook(void *hook_data, void *call_data)
   TimeWindow time_window = 
     lttvwindow_get_time_window(control_flow_data->tab);
 
-  LttTime end_time = ltt_time_add(time_window.start_time,
-                                    time_window.time_width);
+  LttTime end_time = time_window.end_time;
 
   if(ltt_time_compare(evtime, time_window.start_time) == -1
         || ltt_time_compare(evtime, end_time) == 1)
@@ -2218,8 +2207,7 @@ int before_process_hook(void *hook_data, void *call_data)
     guint y = 0, height = 0, pl_height = 0;
     HashedProcessData *hashed_process_data = NULL;
 
-    ProcessList *process_list =
-      guicontrolflow_get_process_list(control_flow_data);
+    ProcessList *process_list = control_flow_data->process_list;
     
     g_assert(process != NULL);
 
@@ -2289,6 +2277,7 @@ int before_process_hook(void *hook_data, void *call_data)
                          drawing->gc,
                          x,
                          y+(height/2)-3);
+          hashed_process_data->x.middle_marked = TRUE;
         }
         /* jump */
       } else {
@@ -2364,8 +2353,7 @@ int after_process_hook(void *hook_data, void *call_data)
   TimeWindow time_window = 
     lttvwindow_get_time_window(control_flow_data->tab);
 
-  LttTime end_time = ltt_time_add(time_window.start_time,
-                                    time_window.time_width);
+  LttTime end_time = time_window.end_time;
 
   if(ltt_time_compare(evtime, time_window.start_time) == -1
         || ltt_time_compare(evtime, end_time) == 1)
@@ -2393,9 +2381,7 @@ int after_process_hook(void *hook_data, void *call_data)
     guint y_child = 0, height = 0, pl_height = 0;
     HashedProcessData *hashed_process_data_child = NULL;
 
-    ProcessList *process_list =
-      guicontrolflow_get_process_list(control_flow_data);
-    
+    ProcessList *process_list = control_flow_data->process_list;
 
     /* Find child in the list... */
     process_child = lttv_state_find_process(tfs, child_pid);
@@ -2469,9 +2455,7 @@ int after_process_hook(void *hook_data, void *call_data)
     guint y = 0, height = 0, pl_height = 0;
     HashedProcessData *hashed_process_data = NULL;
 
-    ProcessList *process_list =
-      guicontrolflow_get_process_list(control_flow_data);
-    
+    ProcessList *process_list = control_flow_data->process_list;
 
     /* It should exist, because we are after the state update. */
     g_assert(process != NULL);
@@ -2574,10 +2558,8 @@ gint update_time_window_hook(void *hook_data, void *call_data)
     g_info("scrolling");
     LttTime *ns = &new_time_window->start_time;
     LttTime *os = &old_time_window->start_time;
-    LttTime old_end = ltt_time_add(old_time_window->start_time,
-                                    old_time_window->time_width);
-    LttTime new_end = ltt_time_add(new_time_window->start_time,
-                                    new_time_window->time_width);
+    LttTime old_end = old_time_window->end_time;
+    LttTime new_end = new_time_window->end_time;
     //if(ns<os+w<ns+w)
     //if(ns<os+w && os+w<ns+w)
     //if(ns<old_end && os<ns)
@@ -2899,6 +2881,7 @@ gint update_current_time_hook(void *hook_data, void *call_data)
   
     new_time_window.start_time = time_begin;
     new_time_window.time_width = width;
+    new_time_window.end_time = ltt_time_add(time_begin, width);
 
     lttvwindow_report_time_window(control_flow_data->tab, new_time_window);
   }
@@ -2913,6 +2896,7 @@ gint update_current_time_hook(void *hook_data, void *call_data)
   
     new_time_window.start_time = time_begin;
     new_time_window.time_width = width;
+    new_time_window.end_time = ltt_time_add(time_begin, width);
 
     lttvwindow_report_time_window(control_flow_data->tab, new_time_window);
     
@@ -2950,8 +2934,7 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data)
   TimeWindow time_window = 
     lttvwindow_get_time_window(control_flow_data->tab);
 
-  LttTime end_time = ltt_time_add(time_window.start_time,
-                                    time_window.time_width);
+  LttTime end_time = time_window.end_time;
 
   if(ltt_time_compare(evtime, time_window.start_time) == -1
         || ltt_time_compare(evtime, end_time) == 1)
@@ -2982,8 +2965,7 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data)
       /* Only draw for processes that are currently in the trace states */
 
       guint y = 0, height = 0, pl_height = 0;
-      ProcessList *process_list = 
-                      guicontrolflow_get_process_list(control_flow_data);
+      ProcessList *process_list = control_flow_data->process_list;
       LttTime birth = process_info->birth;
       
       /* Should be alike when background info is ready */
@@ -3065,6 +3047,7 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data)
                            drawing->gc,
                            x,
                            y+(height/2)-3);
+            hashed_process_data->x.middle_marked = TRUE;
           }
           /* Jump */
         } else {
@@ -3123,8 +3106,7 @@ int after_request(void *hook_data, void *call_data)
   LttvTracesetState *tss = LTTV_TRACESET_STATE(call_data);
   LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(call_data);
   
-  ProcessList *process_list =
-    guicontrolflow_get_process_list(control_flow_data);
+  ProcessList *process_list = control_flow_data->process_list;
   LttTime end_time = events_request->end_time;
 
   ClosureData closure_data;
@@ -3155,8 +3137,7 @@ int after_chunk(void *hook_data, void *call_data)
   LttvTracefileContext *tfc = lttv_traceset_context_get_current_tfc(tsc);
   LttTime end_time;
   
-  ProcessList *process_list =
-    guicontrolflow_get_process_list(control_flow_data);
+  ProcessList *process_list = control_flow_data->process_list;
 
   if(tfc != NULL)
     end_time = LTT_TIME_MIN(tfc->timestamp, events_request->end_time);
This page took 0.025969 seconds and 4 git commands to generate.