Remove reference to thread brand
[lttv.git] / lttv / modules / gui / resourceview / drawing.c
index 033475adaffdcf0f7e2a15674dab76e561e1d4e4..ecb8270d8a73b0f0e34444c500a1949f748fba78 100644 (file)
 #include <gdk/gdk.h>
 #include <string.h>
 
-#include <ltt/trace.h>
-
 #include <lttv/lttv.h>
-#include <lttv/tracecontext.h>
 #include <lttvwindow/lttvwindow.h>
 #include <lttv/state.h>
 #include <lttv/hook.h>
@@ -151,6 +148,7 @@ void drawing_data_request(Drawing_t *drawing,
   Tab *tab = drawing->control_flow_data->tab;
   TimeWindow time_window =
               lttvwindow_get_time_window(tab);
+  LttvTraceset *traceset = lttvwindow_get_traceset(tab);
 
   ControlFlowData *control_flow_data = drawing->control_flow_data;
   //    (ControlFlowData*)g_object_get_data(
@@ -184,34 +182,27 @@ void drawing_data_request(Drawing_t *drawing,
                                        control_flow_data);
 
   {
-    /* find the tracehooks */
-    LttvTracesetContext *tsc = lttvwindow_get_traceset_context(tab);
-
-    LttvTraceset *traceset = tsc->ts;
+    LttvHooks *event_hook = lttv_hooks_new();
+        
+    lttv_hooks_add(event_hook,before_schedchange_hook , control_flow_data, LTTV_PRIO_STATE-5); 
+    lttv_hooks_add(event_hook,before_execmode_hook , control_flow_data, LTTV_PRIO_STATE-5);    
+    lttv_hooks_add(event_hook, after_schedchange_hook, control_flow_data, LTTV_PRIO_STATE+5);       
 
-    guint i, k, l, nb_trace;
+    /* find the tracehooks */
 
     LttvTraceState *ts;
-
-    LttvTracefileState *tfs;
-
     GArray *hooks;
 
-    LttvTraceHook *hook;
-
-    LttvTraceHook *th;
-
-    guint ret;
+    guint i, k;
     guint first_after;
 
-    nb_trace = lttv_traceset_number(traceset);
+    guint nb_trace = lttv_traceset_number(traceset);
     // FIXME  (fixed) : eventually request for more traces
     for(i = 0 ; i < nb_trace ; i++) {
       EventsRequest *events_request = g_new(EventsRequest, 1);
       // Create the hooks
       //LttvHooks *event = lttv_hooks_new();
-      LttvHooksByIdChannelArray *event_by_id_channel =
-        lttv_hooks_by_id_channel_new();
+      
       LttvHooks *before_chunk_traceset = lttv_hooks_new();
       LttvHooks *after_chunk_traceset = lttv_hooks_new();
       LttvHooks *before_request_hook = lttv_hooks_new();
@@ -237,7 +228,7 @@ void drawing_data_request(Drawing_t *drawing,
                      events_request,
                      LTTV_PRIO_DEFAULT);
 
-
+#ifdef BABEL_CLEANUP
       ts = (LttvTraceState *)tsc->traces[i];
 
       /* Find the eventtype id for the following events and register the
@@ -436,14 +427,6 @@ void drawing_data_request(Drawing_t *drawing,
 //          &hooks);
 //
 //      lttv_trace_find_hook(ts->parent.t,
-//          LTT_FACILITY_USER_GENERIC,
-//          LTT_EVENT_THREAD_BRAND,
-//          FIELD_ARRAY(LTT_FIELD_NAME),
-//          after_user_generic_thread_brand_hook,
-//          events_request,
-//          &hooks);
-//
-//      lttv_trace_find_hook(ts->parent.t,
 //          LTT_FACILITY_LIST,
 //          LTT_EVENT_PROCESS_STATE,
 //          FIELD_ARRAY(LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME),
@@ -474,7 +457,7 @@ void drawing_data_request(Drawing_t *drawing,
       }
       
       events_request->hooks = hooks;
-
+#endif
       // Fill the events request
       events_request->owner = control_flow_data;
       events_request->viewer_data = control_flow_data;
@@ -489,8 +472,7 @@ void drawing_data_request(Drawing_t *drawing,
       events_request->before_chunk_traceset = before_chunk_traceset;
       events_request->before_chunk_trace = NULL;
       events_request->before_chunk_tracefile = NULL;
-      events_request->event = NULL;
-      events_request->event_by_id_channel = event_by_id_channel;
+      events_request->event = event_hook;
       events_request->after_chunk_tracefile = NULL;
       events_request->after_chunk_trace = NULL;
       events_request->after_chunk_traceset = after_chunk_traceset;
@@ -530,13 +512,12 @@ static void set_last_start(gpointer key, gpointer value, gpointer user_data)
   return;
 }
 
-void drawing_data_request_begin(EventsRequest *events_request, LttvTracesetState *tss)
+void drawing_data_request_begin(EventsRequest *events_request)
 {
   int i;
 
   g_debug("Begin of data request");
   ControlFlowData *cfd = events_request->viewer_data;
-  LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tss);
   TimeWindow time_window = 
     lttvwindow_get_time_window(cfd->tab);
 
@@ -558,20 +539,17 @@ void drawing_data_request_begin(EventsRequest *events_request, LttvTracesetState
 
 }
 
-void drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState *tss)
+void drawing_chunk_begin(EventsRequest *events_request, LttvTraceset *ts)
 {
   g_debug("Begin of chunk");
   ControlFlowData *cfd = events_request->viewer_data;
-  LttvTracesetContext *tsc = &tss->parent;
-  //LttTime current_time = lttv_traceset_context_get_current_tfc(tsc)->timestamp;
   guint i;
-  LttvTraceset *traceset = tsc->ts;
-  guint nb_trace = lttv_traceset_number(traceset);
+  guint nb_trace = lttv_traceset_number(ts);
   
   if(!cfd->process_list->current_hash_data) {
     cfd->process_list->current_hash_data = g_new(HashedResourceData**,nb_trace);
     for(i = 0 ; i < nb_trace ; i++) {
-      guint num_cpu = ltt_trace_get_num_cpu(tss->parent.traces[i]->t);
+      guint num_cpu = lttv_trace_get_num_cpu(lttv_traceset_get(ts, i));
       cfd->process_list->current_hash_data[i] = g_new(HashedResourceData*,num_cpu);
       memset(cfd->process_list->current_hash_data[i], 0,
              sizeof(HashedResourceData*)*num_cpu);
@@ -583,14 +561,12 @@ void drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState *tss)
 
 
 void drawing_request_expose(EventsRequest *events_request,
-                            LttvTracesetState *tss,
                             LttTime end_time)
 {
   gint x, width;
   guint x_end;
 
   ControlFlowData *cfd = events_request->viewer_data;
-  LttvTracesetContext *tsc = (LttvTracesetContext*)tss;
   Drawing_t *drawing = cfd->drawing;
   
   TimeWindow time_window = 
@@ -1339,20 +1315,7 @@ void drawing_remove_square(Drawing_t *drawing,
 
 void drawing_update_ruler(Drawing_t *drawing, TimeWindow *time_window)
 {
-  GtkRequisition req;
-  GdkRectangle rect;
-  
-  req.width = drawing->ruler->allocation.width;
-  req.height = drawing->ruler->allocation.height;
-
-  rect.x = 0;
-  rect.y = 0;
-  rect.width = req.width;
-  rect.height = req.height;
-
   gtk_widget_queue_draw(drawing->ruler);
-  //gtk_widget_draw( drawing->ruler, &rect);
 }
 
 /* Redraw the ruler */
This page took 0.024547 seconds and 4 git commands to generate.