wish list
[lttv.git] / ltt / branches / poly / lttv / modules / gui / controlflow / eventhooks.c
index ea08a9d7bbac082cc0374e0c94651244b531c2dd..9beac5d486318bce81337fdc3ce518a815a1186e 100644 (file)
@@ -157,6 +157,17 @@ int draw_event_hook(void *hook_data, void *call_data)
   LttEvent *e;
   e = tfc->e;
 
+  LttTime evtime = ltt_event_time(e);
+  TimeWindow *time_window = 
+    guicontrolflow_get_time_window(control_flow_data);
+
+  LttTime end_time = ltt_time_add(time_window->start_time,
+                                    time_window->time_width);
+  //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)
+            return;
+
   if(strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"schedchange") == 0)
   {
     g_critical("schedchange!");
@@ -265,8 +276,7 @@ int draw_event_hook(void *hook_data, void *call_data)
         time,
         width,
         &x);
-    
-    assert(x <= width);
+    //assert(x <= width);
     
     /* draw what represents the event for outgoing process. */
 
@@ -304,8 +314,8 @@ int draw_event_hook(void *hook_data, void *call_data)
     else if(process_out->state->s == LTTV_STATE_WAIT_FORK)
     {
       prop_text_out.foreground->red = 0x0fff;
-      prop_text_out.foreground->green = 0x0000;
-      prop_text_out.foreground->blue = 0x0fff;
+      prop_text_out.foreground->green = 0xffff;
+      prop_text_out.foreground->blue = 0xfff0;
     }
     else if(process_out->state->s == LTTV_STATE_WAIT_CPU)
     {
@@ -338,6 +348,7 @@ int draw_event_hook(void *hook_data, void *call_data)
       prop_text_out.foreground->blue = 0xffff;
     }
  
+    
     /* Print status of the process : U, WF, WC, E, W, R */
     if(process_out->state->s == LTTV_STATE_UNNAMED)
       prop_text_out.text = "U->";
@@ -378,6 +389,8 @@ int draw_event_hook(void *hook_data, void *call_data)
     prop_line_out.line_width = 2;
     prop_line_out.style = GDK_LINE_SOLID;
     prop_line_out.position = MIDDLE;
+    
+    g_critical("out state : %s", g_quark_to_string(process_out->state->s));
 
     /* color of line : status of the process */
     if(process_out->state->s == LTTV_STATE_UNNAMED)
@@ -389,8 +402,8 @@ int draw_event_hook(void *hook_data, void *call_data)
     else if(process_out->state->s == LTTV_STATE_WAIT_FORK)
     {
       prop_line_out.color->red = 0x0fff;
-      prop_line_out.color->green = 0x0000;
-      prop_line_out.color->blue = 0x0fff;
+      prop_line_out.color->green = 0xffff;
+      prop_line_out.color->blue = 0xfff0;
     }
     else if(process_out->state->s == LTTV_STATE_WAIT_CPU)
     {
@@ -454,6 +467,7 @@ int draw_event_hook(void *hook_data, void *call_data)
     prop_text_in.size = 6;
     prop_text_in.position = OVER;
 
+    g_critical("in state : %s", g_quark_to_string(process_in->state->s));
     /* foreground of text : status of the process */
     if(process_in->state->s == LTTV_STATE_UNNAMED)
     {
@@ -464,8 +478,8 @@ int draw_event_hook(void *hook_data, void *call_data)
     else if(process_in->state->s == LTTV_STATE_WAIT_FORK)
     {
       prop_text_in.foreground->red = 0x0fff;
-      prop_text_in.foreground->green = 0x0000;
-      prop_text_in.foreground->blue = 0x0fff;
+      prop_text_in.foreground->green = 0xffff;
+      prop_text_in.foreground->blue = 0xfff0;
     }
     else if(process_in->state->s == LTTV_STATE_WAIT_CPU)
     {
@@ -551,8 +565,8 @@ int draw_event_hook(void *hook_data, void *call_data)
     else if(process_in->state->s == LTTV_STATE_WAIT_FORK)
     {
       prop_line_in.color->red = 0x0fff;
-      prop_line_in.color->green = 0x0000;
-      prop_line_in.color->blue = 0x0fff;
+      prop_line_in.color->green = 0xffff;
+      prop_line_in.color->blue = 0xfff0;
     }
     else if(process_in->state->s == LTTV_STATE_WAIT_CPU)
     {
@@ -628,6 +642,18 @@ int draw_after_hook(void *hook_data, void *call_data)
   LttEvent *e;
   e = tfc->e;
 
+  LttTime evtime = ltt_event_time(e);
+  TimeWindow *time_window = 
+    guicontrolflow_get_time_window(control_flow_data);
+
+  LttTime end_time = ltt_time_add(time_window->start_time,
+                                    time_window->time_width);
+  //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)
+            return;
+
+
   if(strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"schedchange") == 0)
   {
     g_critical("schedchange!");
@@ -772,8 +798,8 @@ int draw_after_hook(void *hook_data, void *call_data)
     else if(process_out->state->s == LTTV_STATE_WAIT_FORK)
     {
       prop_text_out.foreground->red = 0x0fff;
-      prop_text_out.foreground->green = 0x0000;
-      prop_text_out.foreground->blue = 0x0fff;
+      prop_text_out.foreground->green = 0xffff;
+      prop_text_out.foreground->blue = 0xfff0;
     }
     else if(process_out->state->s == LTTV_STATE_WAIT_CPU)
     {
@@ -892,8 +918,8 @@ int draw_after_hook(void *hook_data, void *call_data)
     else if(process_in->state->s == LTTV_STATE_WAIT_FORK)
     {
       prop_text_in.foreground->red = 0x0fff;
-      prop_text_in.foreground->green = 0x0000;
-      prop_text_in.foreground->blue = 0x0fff;
+      prop_text_in.foreground->green = 0xffff;
+      prop_text_in.foreground->blue = 0xfff0;
     }
     else if(process_in->state->s == LTTV_STATE_WAIT_CPU)
     {
@@ -1341,8 +1367,8 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data)
   else if(process->state->s == LTTV_STATE_WAIT_FORK)
   {
     prop_line.color->red = 0x0fff;
-    prop_line.color->green = 0x0000;
-    prop_line.color->blue = 0x0fff;
+    prop_line.color->green = 0xffff;
+    prop_line.color->blue = 0xfff0;
   }
   else if(process->state->s == LTTV_STATE_WAIT_CPU)
   {
This page took 0.026389 seconds and 4 git commands to generate.