process list pid problem : everything is zero
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 8 Jan 2004 15:25:35 +0000 (15:25 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 8 Jan 2004 15:25:35 +0000 (15:25 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@360 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c
ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.h
ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c

index e89c8b295b6896125f35c4eb4f4a15d00c803a54..cbd2e1059b385d89edc7a130b14e158f41fa99f6 100644 (file)
@@ -62,12 +62,20 @@ void drawing_data_request(Drawing_t *Drawing,
        LttTime window_end = ltt_time_add(control_flow_data->Time_Window.time_width,
                                                                                                control_flow_data->Time_Window.start_time);
 
-       convert_pixels_to_time(Drawing, x,
+       g_critical("req : window_end : %u, %u", window_end.tv_sec, 
+                                                                                                                                                       window_end.tv_nsec);
+
+       g_critical("req : time width : %u, %u", control_flow_data->Time_Window.time_width.tv_sec, 
+                                                                                                                               control_flow_data->Time_Window.time_width.tv_nsec);
+       
+       g_critical("x is : %i, x+width is : %i", x, x+width);
+
+       convert_pixels_to_time(width, x,
                                &control_flow_data->Time_Window.start_time,
                                &window_end,
                                &start);
 
-       convert_pixels_to_time(Drawing, x + width,
+       convert_pixels_to_time(width, x + width,
                                &control_flow_data->Time_Window.start_time,
                                &window_end,
                                &end);
@@ -82,9 +90,9 @@ void drawing_data_request(Drawing_t *Drawing,
                      width,    // do not overlap
                      height);
 
-  send_test_process(
-       guicontrolflow_get_process_list(Drawing->Control_Flow_Data),
-       Drawing);
+  //send_test_process(
+       //guicontrolflow_get_process_list(Drawing->Control_Flow_Data),
+       //Drawing);
   //send_test_drawing(
        //guicontrolflow_get_process_list(Drawing->Control_Flow_Data),
        //Drawing, *Pixmap, x, y, width, height);
@@ -95,6 +103,12 @@ void drawing_data_request(Drawing_t *Drawing,
        event_request.time_begin = start;
        event_request.time_end = end;
 
+       g_critical("req : start : %u, %u", event_request.time_begin.tv_sec, 
+                                                                                                                                                       event_request.time_begin.tv_nsec);
+
+       g_critical("req : end : %u, %u", event_request.time_end.tv_sec, 
+                                                                                                                                                       event_request.time_end.tv_nsec);
+       
        LttvHooks *event = lttv_hooks_new();
        lttv_hooks_add(event, draw_event_hook, &event_request);
 
@@ -286,7 +300,7 @@ GtkWidget *drawing_get_widget(Drawing_t *Drawing)
  * Convert from window pixel and time interval to an absolute time.
  */
 void convert_pixels_to_time(
-               Drawing_t *Drawing,
+               gint width,
                guint x,
                LttTime *window_time_begin,
                LttTime *window_time_end,
@@ -296,7 +310,7 @@ void convert_pixels_to_time(
        
        window_time_interval = ltt_time_sub(*window_time_end, 
             *window_time_begin);
-       *time = ltt_time_mul(window_time_interval, (x/(float)Drawing->width));
+       *time = ltt_time_mul(window_time_interval, (x/(float)width));
        *time = ltt_time_add(*window_time_begin, *time);
 }
 
@@ -306,7 +320,7 @@ void convert_time_to_pixels(
                LttTime window_time_begin,
                LttTime window_time_end,
                LttTime time,
-               Drawing_t *Drawing,
+               int width,
                guint *x)
 {
        LttTime window_time_interval;
@@ -319,7 +333,7 @@ void convert_time_to_pixels(
        interval_float = ltt_time_to_double(window_time_interval);
        time_float = ltt_time_to_double(time);
 
-       *x = (guint)(time_float/interval_float * Drawing->width);
+       *x = (guint)(time_float/interval_float * width);
        
 }
 
index 4957fb824d65669da8aeef258f392a0b59513814..6ae2f19192159e6ca0581198a9d0d413479106d7 100644 (file)
@@ -75,7 +75,7 @@ void drawing_remove_square(Drawing_t *Drawing,
 //void Drawing_Resize(Drawing_t *Drawing, guint h, guint w);
 
 void convert_pixels_to_time(
-               Drawing_t *Drawing,
+               gint width,
                guint x,
                LttTime *window_time_begin,
                LttTime *window_time_end,
@@ -85,7 +85,7 @@ void convert_time_to_pixels(
                LttTime window_time_begin,
                LttTime window_time_end,
                LttTime time,
-               Drawing_t *Drawing,
+               int width,
                guint *x);
 
 #endif // _DRAWING_H
index 798d1d2e0ba4693609b0a39b432da484263f6f60..6340bfcba7d1c2e8670476276511c61bdc76c916 100644 (file)
@@ -492,6 +492,64 @@ int draw_event_hook(void *hook_data, void *call_data)
 {
        EventRequest *Event_Request = (EventRequest*)hook_data;
        
+       //static int i=0;
+
+       //i++;
+       //g_critical("%i", i);
+       
+       /* Text dumping if the information */
+       GString *string = g_string_new("");;
+       gboolean field_names = TRUE, state = TRUE;
+  LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
+
+  LttvTracefileState *tfs = (LttvTracefileState *)call_data;
+
+  LttEvent *e;
+
+  e = tfc->e;
+
+  lttv_event_to_string(e, tfc->tf, string, TRUE, field_names, tfs);
+  g_string_append_printf(string,"\n");  
+
+  if(state) {
+    g_string_append_printf(string, " %s",
+        g_quark_to_string(tfs->process->state->s));
+  }
+
+  g_info("%s",string->str);
+
+       g_string_free(string, TRUE);
+       
+       /* End of text dump */
+
+       /* Add process to process list (if not present) and get drawing "y" from
+        * process position */
+       guint pid = tfs->process->pid;
+       LttTime birth = tfs->process->creation_time;
+       guint y = 0, height = 0;
+       ProcessList *process_list =
+               guicontrolflow_get_process_list(Event_Request->Control_Flow_Data);
+       
+       if(processlist_get_process_pixels(process_list,
+                                       pid,
+                                       &birth,
+                                       &y,
+                                       &height) == 1)
+       {
+               /* Process not present */
+               processlist_add(process_list,
+                               pid,
+                               &birth,
+                               &y);
+               drawing_insert_square( Event_Request->Control_Flow_Data->Drawing, y, height);
+       }
+
+       /* Find pixels corresponding to time of the event. If the time does
+        * not fit in the window, show a warning, not supposed to happend. */
+       
+
+       /* Finally, draw what represents the event. */
+       
        
        return 0;
 }
This page took 0.027668 seconds and 4 git commands to generate.