control flow now uses by_id hooks : performance fix
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 12 Aug 2004 15:45:04 +0000 (15:45 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 12 Aug 2004 15:45:04 +0000 (15:45 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@714 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c
ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c
ltt/branches/poly/lttv/modules/gui/detailedevents/events.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h

index d1b631006bedd4fb0583642f5393396f7ac3d79d..e877e6d99cca540a9ce60c896db30db0c5150b17 100644 (file)
@@ -33,6 +33,9 @@
 #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
 #define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
 
+//FIXME
+#define TRACE_NUMBER 0
+
 
 GdkColor drawing_colors[NUM_COLORS] =
 { /* Pixel, R, G, B */
@@ -85,12 +88,11 @@ void drawing_data_request(Drawing_t *drawing,
   }
 
 
-  
+  Tab *tab = drawing->control_flow_data->tab;
   TimeWindow time_window =
-              lttvwindow_get_time_window(drawing->control_flow_data->tab);
+              lttvwindow_get_time_window(tab);
 
   ControlFlowData *control_flow_data = drawing->control_flow_data;
-  Tab *tab = control_flow_data->tab;
   //    (ControlFlowData*)g_object_get_data(
   //               G_OBJECT(drawing->drawing_area), "control_flow_data");
 
@@ -118,39 +120,203 @@ void drawing_data_request(Drawing_t *drawing,
         time_window.start_time,
         window_end,
         &time_end);
-  
-  EventsRequest *events_request = g_new(EventsRequest, 1);
-  // Create the hooks
-  LttvHooks *event = lttv_hooks_new();
-  LttvHooks *before_chunk_traceset = lttv_hooks_new();
-  LttvHooks *after_chunk_traceset = lttv_hooks_new();
-  LttvHooks *before_request_hook = lttv_hooks_new();
-  LttvHooks *after_request_hook = lttv_hooks_new();
-
-  lttv_hooks_add(before_chunk_traceset,
-                 before_chunk,
-                 events_request,
-                 LTTV_PRIO_DEFAULT);
 
-  lttv_hooks_add(after_chunk_traceset,
-                 after_chunk,
-                 events_request,
-                 LTTV_PRIO_DEFAULT);
+  lttvwindow_events_request_remove_all(tab,
+                                       control_flow_data);
 
-  lttv_hooks_add(before_request_hook,
-                 before_request,
-                 events_request,
-                 LTTV_PRIO_DEFAULT);
+  {
+    /* find the tracehooks */
+    LttvTracesetContext *tsc = lttvwindow_get_traceset_context(tab);
 
-  lttv_hooks_add(after_request_hook,
-                 after_request,
-                 events_request,
-                 LTTV_PRIO_DEFAULT);
+    LttvTraceset *traceset = tsc->ts;
 
-  /* FIXME : hooks are registered global instead of by ID.
-   * This is due to the lack of granularity of main window's events requests.
-   * Should be fixed for gain of performance.
-   */
+    guint i, k, nb_trace;
+
+    LttvTraceState *ts;
+
+    LttvTracefileState *tfs;
+
+    GArray *hooks;
+
+    LttvTraceHook hook;
+
+    LttvAttributeValue val;
+
+    nb_trace = lttv_traceset_number(traceset);
+    // FIXME : eventually request for more traces
+    // for(i = 0 ; i < nb_trace ; i++) {
+    g_assert(TRACE_NUMBER < nb_trace);
+    i = TRACE_NUMBER;
+    {
+      EventsRequest *events_request = g_new(EventsRequest, 1);
+      // Create the hooks
+      //LttvHooks *event = lttv_hooks_new();
+      LttvHooksById *event_by_id = lttv_hooks_by_id_new();
+      LttvHooks *before_chunk_traceset = lttv_hooks_new();
+      LttvHooks *after_chunk_traceset = lttv_hooks_new();
+      LttvHooks *before_request_hook = lttv_hooks_new();
+      LttvHooks *after_request_hook = lttv_hooks_new();
+
+      lttv_hooks_add(before_chunk_traceset,
+                     before_chunk,
+                     events_request,
+                     LTTV_PRIO_DEFAULT);
+
+      lttv_hooks_add(after_chunk_traceset,
+                     after_chunk,
+                     events_request,
+                     LTTV_PRIO_DEFAULT);
+
+      lttv_hooks_add(before_request_hook,
+                     before_request,
+                     events_request,
+                     LTTV_PRIO_DEFAULT);
+
+      lttv_hooks_add(after_request_hook,
+                     after_request,
+                     events_request,
+                     LTTV_PRIO_DEFAULT);
+
+
+      ts = (LttvTraceState *)tsc->traces[i];
+
+      /* Find the eventtype id for the following events and register the
+         associated by id hooks. */
+
+      hooks = g_array_new(FALSE, FALSE, sizeof(LttvTraceHook));
+      g_array_set_size(hooks, 16);
+
+      /* before hooks */
+      
+      lttv_trace_find_hook(ts->parent.t, "core","syscall_entry","syscall_id", 
+    NULL, NULL, before_execmode_hook, &g_array_index(hooks, LttvTraceHook, 0));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "syscall_exit", NULL, NULL, 
+          NULL, before_execmode_hook, &g_array_index(hooks, LttvTraceHook, 1));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "trap_entry", "trap_id",
+    NULL, NULL, before_execmode_hook, &g_array_index(hooks, LttvTraceHook, 2));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "trap_exit", NULL, NULL, NULL, 
+          before_execmode_hook, &g_array_index(hooks, LttvTraceHook, 3));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "irq_entry", "irq_id", NULL, 
+          NULL, before_execmode_hook, &g_array_index(hooks, LttvTraceHook, 4));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "irq_exit", NULL, NULL, NULL, 
+          before_execmode_hook, &g_array_index(hooks, LttvTraceHook, 5));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "schedchange", "in", "out", 
+        "out_state", before_schedchange_hook, 
+        &g_array_index(hooks, LttvTraceHook, 6));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "process", "event_sub_id", 
+          "event_data1", "event_data2", before_process_hook,
+          &g_array_index(hooks, LttvTraceHook, 7));
+
+#if 0
+      lttv_trace_find_hook(ts->parent.t, "core", "process_fork", "child_pid", 
+          NULL, NULL, process_fork, &g_array_index(hooks, LttvTraceHook, 7));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "process_exit", NULL, NULL, 
+          NULL, process_exit, &g_array_index(hooks, LttvTraceHook, 8));
+#endif //0
+
+      /* after hooks */
+      
+      lttv_trace_find_hook(ts->parent.t, "core","syscall_entry","syscall_id", 
+    NULL, NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 8));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "syscall_exit", NULL, NULL, 
+          NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 9));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "trap_entry", "trap_id",
+    NULL, NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 10));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "trap_exit", NULL, NULL, NULL, 
+          after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 11));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "irq_entry", "irq_id", NULL, 
+          NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 12));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "irq_exit", NULL, NULL, NULL, 
+          after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 13));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "schedchange", "in", "out", 
+        "out_state", after_schedchange_hook, 
+        &g_array_index(hooks, LttvTraceHook, 14));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "process", "event_sub_id", 
+          "event_data1", "event_data2", after_process_hook,
+          &g_array_index(hooks, LttvTraceHook, 15));
+
+#if 0
+      lttv_trace_find_hook(ts->parent.t, "core", "process_fork", "child_pid", 
+          NULL, NULL, process_fork, &g_array_index(hooks, LttvTraceHook, 7));
+
+      lttv_trace_find_hook(ts->parent.t, "core", "process_exit", NULL, NULL, 
+          NULL, process_exit, &g_array_index(hooks, LttvTraceHook, 8));
+#endif //0
+
+
+      
+      /* Add these hooks to each event_by_id hooks list */
+
+      /* add before */
+      for(k = 0 ; k < hooks->len/2 ; k++) {
+        hook = g_array_index(hooks, LttvTraceHook, k);
+        lttv_hooks_add(lttv_hooks_by_id_find(event_by_id, 
+                        hook.id), hook.h,
+                        events_request,
+                        LTTV_PRIO_STATE-5);
+      }
+
+      /* add after */
+      for(k = hooks->len/2 ; k < hooks->len ; k++) {
+        hook = g_array_index(hooks, LttvTraceHook, k);
+        lttv_hooks_add(lttv_hooks_by_id_find(event_by_id, 
+                       hook.id), hook.h,
+                       events_request,
+                       LTTV_PRIO_STATE+5);
+      }
+
+      events_request->hooks = hooks;
+
+      // Fill the events request
+      events_request->owner = control_flow_data;
+      events_request->viewer_data = control_flow_data;
+      events_request->servicing = FALSE;
+      events_request->start_time = start;
+      events_request->start_position = NULL;
+      events_request->stop_flag = FALSE;
+      events_request->end_time = time_end;
+      events_request->num_events = G_MAXUINT;
+      events_request->end_position = NULL;
+      events_request->trace = i;    /* FIXME */
+      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 = event_by_id;
+      events_request->after_chunk_tracefile = NULL;
+      events_request->after_chunk_trace = NULL;
+      events_request->after_chunk_traceset = after_chunk_traceset;
+      events_request->before_request = before_request_hook;
+      events_request->after_request = after_request_hook;
+
+      g_debug("req : start : %u, %u", start.tv_sec, 
+                                          start.tv_nsec);
+
+      g_debug("req : end : %u, %u", time_end.tv_sec, 
+                                         time_end.tv_nsec);
+
+      lttvwindow_events_request(tab, events_request);
+
+    }
+
+  }
+
+#if 0
   lttv_hooks_add(event,
                  before_schedchange_hook,
                  events_request,
@@ -175,38 +341,8 @@ void drawing_data_request(Drawing_t *drawing,
                  after_process_hook,
                  events_request,
                  LTTV_PRIO_STATE+5);
+#endif //0
 
-  // Fill the events request
-  events_request->owner = control_flow_data;
-  events_request->viewer_data = control_flow_data;
-  events_request->servicing = FALSE;
-  events_request->start_time = start;
-  events_request->start_position = NULL;
-  events_request->stop_flag = FALSE;
-  events_request->end_time = time_end;
-  events_request->num_events = G_MAXUINT;
-  events_request->end_position = NULL;
-  events_request->trace = 0;    /* FIXME */
-  events_request->before_chunk_traceset = before_chunk_traceset;
-  events_request->before_chunk_trace = NULL;
-  events_request->before_chunk_tracefile = NULL;
-  events_request->event = event;
-  events_request->event_by_id = NULL;
-  events_request->after_chunk_tracefile = NULL;
-  events_request->after_chunk_trace = NULL;
-  events_request->after_chunk_traceset = after_chunk_traceset;
-  events_request->before_request = before_request_hook;
-  events_request->after_request = after_request_hook;
-
-  g_debug("req : start : %u, %u", start.tv_sec, 
-                                      start.tv_nsec);
-
-  g_debug("req : end : %u, %u", time_end.tv_sec, 
-                                     time_end.tv_nsec);
-
-  lttvwindow_events_request_remove_all(tab,
-                                       control_flow_data);
-  lttvwindow_events_request(tab, events_request);
 }
  
 
index 23bd9ff7b9b3b6eddc36fc2702f05683de38f12d..3b779352201c0e31f9be48f65084cbde8c813c6b 100644 (file)
@@ -351,233 +351,230 @@ int before_schedchange_hook(void *hook_data, void *call_data)
 
   guint width = drawing->width;
 
-  if(strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"schedchange") == 0) {
-
-    /* we are in a schedchange, before the state update. We must draw the
-     * items corresponding to the state before it changes : now is the right
-     * time to do it.
-     */
+  /* we are in a schedchange, before the state update. We must draw the
+   * items corresponding to the state before it changes : now is the right
+   * time to do it.
+   */
 
-    guint pid_out;
-    guint pid_in;
-    {
-      LttField *f = ltt_event_field(e);
-      LttField *element;
-      element = ltt_field_member(f,0);
-      pid_out = ltt_event_get_long_unsigned(e,element);
-      element = ltt_field_member(f,1);
-      pid_in = ltt_event_get_long_unsigned(e,element);
-      g_debug("out : %u  in : %u", pid_out, pid_in);
-    }
+  guint pid_out;
+  guint pid_in;
+  {
+    LttField *f = ltt_event_field(e);
+    LttField *element;
+    element = ltt_field_member(f,0);
+    pid_out = ltt_event_get_long_unsigned(e,element);
+    element = ltt_field_member(f,1);
+    pid_in = ltt_event_get_long_unsigned(e,element);
+    g_debug("out : %u  in : %u", pid_out, pid_in);
+  }
+  
+  { 
+    /* For the pid_out */
+    /* First, check if the current process is in the state computation
+     * process list. If it is there, that means we must add it right now and
+     * draw items from the beginning of the read for it. If it is not
+     * present, it's a new process and it was not present : it will
+     * be added after the state update.  */
+    LttvProcessState *process;
+    process = lttv_state_find_process(tfs, pid_out);
     
-    { 
-      /* For the pid_out */
-      /* First, check if the current process is in the state computation
-       * process list. If it is there, that means we must add it right now and
-       * draw items from the beginning of the read for it. If it is not
-       * present, it's a new process and it was not present : it will
-       * be added after the state update.  */
-      LttvProcessState *process;
-      process = lttv_state_find_process(tfs, pid_out);
+    if(process != NULL) {
+      /* Well, the process_out existed : we must get it in the process hash
+       * or add it, and draw its items.
+       */
+       /* 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);
+      LttTime birth = process->creation_time;
+      const gchar *name = g_quark_to_string(process->name);
       
-      if(process != NULL) {
-        /* Well, the process_out existed : we must get it in the process hash
-         * or add it, and draw its items.
-         */
-         /* 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);
-        LttTime birth = process->creation_time;
-        const gchar *name = g_quark_to_string(process->name);
-        
-        if(processlist_get_process_pixels(process_list,
+      if(processlist_get_process_pixels(process_list,
+              pid_out,
+              process->last_cpu,
+              &birth,
+              tfc->t_context->index,
+              &y,
+              &height,
+              &hashed_process_data) == 1)
+      {
+        g_assert(pid_out == 0 || pid_out != process->ppid);
+        /* Process not present */
+        processlist_add(process_list,
+            pid_out,
+            process->last_cpu,
+            process->ppid,
+            &birth,
+            tfc->t_context->index,
+            name,
+            &pl_height,
+            &hashed_process_data);
+        processlist_get_process_pixels(process_list,
                 pid_out,
                 process->last_cpu,
                 &birth,
                 tfc->t_context->index,
                 &y,
                 &height,
-                &hashed_process_data) == 1)
-        {
-          g_assert(pid_out == 0 || pid_out != process->ppid);
-          /* Process not present */
-          processlist_add(process_list,
-              pid_out,
-              process->last_cpu,
-              process->ppid,
-              &birth,
-              tfc->t_context->index,
-              name,
-              &pl_height,
-              &hashed_process_data);
-          processlist_get_process_pixels(process_list,
-                  pid_out,
-                  process->last_cpu,
-                  &birth,
-                  tfc->t_context->index,
-                  &y,
-                  &height,
-                  &hashed_process_data);
-          drawing_insert_square( drawing, y, height);
-        }
+                &hashed_process_data);
+        drawing_insert_square( drawing, y, height);
+      }
+    
+      /* Now, the process is in the state hash and our own process hash.
+       * We definitely can draw the items related to the ending state.
+       */
       
-        /* Now, the process is in the state hash and our own process hash.
-         * We definitely can draw the items related to the ending state.
-         */
-        
-        /* Check if the x position is unset. In can have been left unset by
-         * a draw closure from a after chunk hook. This should never happen,
-         * because it must be set by before chunk hook to the damage_begin
-         * value.
-         */
-        g_assert(hashed_process_data->x.middle != -1);
+      /* Check if the x position is unset. In can have been left unset by
+       * a draw closure from a after chunk hook. This should never happen,
+       * because it must be set by before chunk hook to the damage_begin
+       * value.
+       */
+      g_assert(hashed_process_data->x.middle != -1);
+      {
+        guint x;
+        DrawContext draw_context;
+
+        convert_time_to_pixels(
+            time_window.start_time,
+            end_time,
+            evtime,
+            width,
+            &x);
+
+        /* Now create the drawing context that will be used to draw
+         * items related to the last state. */
+        draw_context.drawable = drawing->pixmap;
+        draw_context.gc = drawing->gc;
+        draw_context.pango_layout = drawing->pango_layout;
+        draw_context.drawinfo.start.x = hashed_process_data->x.middle;
+        draw_context.drawinfo.end.x = x;
+
+        draw_context.drawinfo.y.over = y+1;
+        draw_context.drawinfo.y.middle = y+(height/2);
+        draw_context.drawinfo.y.under = y+height;
+
+        draw_context.drawinfo.start.offset.over = 0;
+        draw_context.drawinfo.start.offset.middle = 0;
+        draw_context.drawinfo.start.offset.under = 0;
+        draw_context.drawinfo.end.offset.over = 0;
+        draw_context.drawinfo.end.offset.middle = 0;
+        draw_context.drawinfo.end.offset.under = 0;
+
         {
-          guint x;
-          DrawContext draw_context;
-
-          convert_time_to_pixels(
-              time_window.start_time,
-              end_time,
-              evtime,
-              width,
-              &x);
-
-          /* Now create the drawing context that will be used to draw
-           * items related to the last state. */
-          draw_context.drawable = drawing->pixmap;
-          draw_context.gc = drawing->gc;
-          draw_context.pango_layout = drawing->pango_layout;
-          draw_context.drawinfo.start.x = hashed_process_data->x.middle;
-          draw_context.drawinfo.end.x = x;
-
-          draw_context.drawinfo.y.over = y+1;
-          draw_context.drawinfo.y.middle = y+(height/2);
-          draw_context.drawinfo.y.under = y+height;
-
-          draw_context.drawinfo.start.offset.over = 0;
-          draw_context.drawinfo.start.offset.middle = 0;
-          draw_context.drawinfo.start.offset.under = 0;
-          draw_context.drawinfo.end.offset.over = 0;
-          draw_context.drawinfo.end.offset.middle = 0;
-          draw_context.drawinfo.end.offset.under = 0;
-
-          {
-            /* Draw the line */
-            PropertiesLine prop_line = prepare_status_line(process);
-            draw_line((void*)&prop_line, (void*)&draw_context);
-
-          }
-          /* become the last x position */
-          hashed_process_data->x.middle = x;
+          /* Draw the line */
+          PropertiesLine prop_line = prepare_status_line(process);
+          draw_line((void*)&prop_line, (void*)&draw_context);
+
         }
+        /* become the last x position */
+        hashed_process_data->x.middle = x;
       }
     }
+  }
 
-    {
-      /* For the pid_in */
-      /* First, check if the current process is in the state computation
-       * process list. If it is there, that means we must add it right now and
-       * draw items from the beginning of the read for it. If it is not
-       * present, it's a new process and it was not present : it will
-       * be added after the state update.  */
-      LttvProcessState *process;
-      process = lttv_state_find_process(tfs, pid_in);
+  {
+    /* For the pid_in */
+    /* First, check if the current process is in the state computation
+     * process list. If it is there, that means we must add it right now and
+     * draw items from the beginning of the read for it. If it is not
+     * present, it's a new process and it was not present : it will
+     * be added after the state update.  */
+    LttvProcessState *process;
+    process = lttv_state_find_process(tfs, pid_in);
+    
+    if(process != NULL) {
+      /* Well, the process_out existed : we must get it in the process hash
+       * or add it, and draw its items.
+       */
+       /* 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);
+      LttTime birth = process->creation_time;
+      const gchar *name = g_quark_to_string(process->name);
       
-      if(process != NULL) {
-        /* Well, the process_out existed : we must get it in the process hash
-         * or add it, and draw its items.
-         */
-         /* 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);
-        LttTime birth = process->creation_time;
-        const gchar *name = g_quark_to_string(process->name);
-        
-        if(processlist_get_process_pixels(process_list,
+      if(processlist_get_process_pixels(process_list,
+              pid_in,
+              process->last_cpu,
+              &birth,
+              tfc->t_context->index,
+              &y,
+              &height,
+              &hashed_process_data) == 1)
+      {
+        g_assert(pid_in == 0 || pid_in != process->ppid);
+        /* Process not present */
+        processlist_add(process_list,
+            pid_in,
+            process->last_cpu,
+            process->ppid,
+            &birth,
+            tfc->t_context->index,
+            name,
+            &pl_height,
+            &hashed_process_data);
+        processlist_get_process_pixels(process_list,
                 pid_in,
                 process->last_cpu,
                 &birth,
                 tfc->t_context->index,
                 &y,
                 &height,
-                &hashed_process_data) == 1)
-        {
-          g_assert(pid_in == 0 || pid_in != process->ppid);
-          /* Process not present */
-          processlist_add(process_list,
-              pid_in,
-              process->last_cpu,
-              process->ppid,
-              &birth,
-              tfc->t_context->index,
-              name,
-              &pl_height,
-              &hashed_process_data);
-          processlist_get_process_pixels(process_list,
-                  pid_in,
-                  process->last_cpu,
-                  &birth,
-                  tfc->t_context->index,
-                  &y,
-                  &height,
-                  &hashed_process_data);
-          drawing_insert_square( drawing, y, height);
-        }
+                &hashed_process_data);
+        drawing_insert_square( drawing, y, height);
+      }
+    
+      /* Now, the process is in the state hash and our own process hash.
+       * We definitely can draw the items related to the ending state.
+       */
       
-        /* Now, the process is in the state hash and our own process hash.
-         * We definitely can draw the items related to the ending state.
-         */
-        
-        /* Check if the x position is unset. In can have been left unset by
-         * a draw closure from a after chunk hook. This should never happen,
-         * because it must be set by before chunk hook to the damage_begin
-         * value.
-         */
-        g_assert(hashed_process_data->x.middle != -1);
-        {
-          guint x;
-          DrawContext draw_context;
-
-          convert_time_to_pixels(
-              time_window.start_time,
-              end_time,
-              evtime,
-              width,
-              &x);
-
-          /* Now create the drawing context that will be used to draw
-           * items related to the last state. */
-          draw_context.drawable = drawing->pixmap;
-          draw_context.gc = drawing->gc;
-          draw_context.pango_layout = drawing->pango_layout;
-          draw_context.drawinfo.start.x = hashed_process_data->x.middle;
-          draw_context.drawinfo.end.x = x;
+      /* Check if the x position is unset. In can have been left unset by
+       * a draw closure from a after chunk hook. This should never happen,
+       * because it must be set by before chunk hook to the damage_begin
+       * value.
+       */
+      g_assert(hashed_process_data->x.middle != -1);
+      {
+        guint x;
+        DrawContext draw_context;
 
-          draw_context.drawinfo.y.over = y+1;
-          draw_context.drawinfo.y.middle = y+(height/2);
-          draw_context.drawinfo.y.under = y+height;
+        convert_time_to_pixels(
+            time_window.start_time,
+            end_time,
+            evtime,
+            width,
+            &x);
+
+        /* Now create the drawing context that will be used to draw
+         * items related to the last state. */
+        draw_context.drawable = drawing->pixmap;
+        draw_context.gc = drawing->gc;
+        draw_context.pango_layout = drawing->pango_layout;
+        draw_context.drawinfo.start.x = hashed_process_data->x.middle;
+        draw_context.drawinfo.end.x = x;
 
-          draw_context.drawinfo.start.offset.over = 0;
-          draw_context.drawinfo.start.offset.middle = 0;
-          draw_context.drawinfo.start.offset.under = 0;
-          draw_context.drawinfo.end.offset.over = 0;
-          draw_context.drawinfo.end.offset.middle = 0;
-          draw_context.drawinfo.end.offset.under = 0;
+        draw_context.drawinfo.y.over = y+1;
+        draw_context.drawinfo.y.middle = y+(height/2);
+        draw_context.drawinfo.y.under = y+height;
 
-          {
-            /* Draw the line */
-            PropertiesLine prop_line = prepare_status_line(process);
-            draw_line((void*)&prop_line, (void*)&draw_context);
-          }
+        draw_context.drawinfo.start.offset.over = 0;
+        draw_context.drawinfo.start.offset.middle = 0;
+        draw_context.drawinfo.start.offset.under = 0;
+        draw_context.drawinfo.end.offset.over = 0;
+        draw_context.drawinfo.end.offset.middle = 0;
+        draw_context.drawinfo.end.offset.under = 0;
 
-          
-          /* become the last x position */
-          hashed_process_data->x.middle = x;
+        {
+          /* Draw the line */
+          PropertiesLine prop_line = prepare_status_line(process);
+          draw_line((void*)&prop_line, (void*)&draw_context);
         }
+
+        
+        /* become the last x position */
+        hashed_process_data->x.middle = x;
       }
     }
   }
@@ -1233,80 +1230,73 @@ int after_schedchange_hook(void *hook_data, void *call_data)
 
   guint width = control_flow_data->drawing->width;
 
-  if(strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"schedchange") == 0) {
+  /* Add process to process list (if not present) */
+  LttvProcessState *process_out, *process_in;
+  LttTime birth;
+  guint y_in = 0, y_out = 0, height = 0, pl_height = 0;
+  HashedProcessData *hashed_process_data_in = NULL;
 
-    g_debug("schedchange!");
-    
-    {
-      /* Add process to process list (if not present) */
-      LttvProcessState *process_out, *process_in;
-      LttTime birth;
-      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);
-      
-      guint pid_in;
-      {
-        guint pid_out;
-        LttField *f = ltt_event_field(e);
-        LttField *element;
-        element = ltt_field_member(f,0);
-        pid_out = ltt_event_get_long_unsigned(e,element);
-        element = ltt_field_member(f,1);
-        pid_in = ltt_event_get_long_unsigned(e,element);
-        g_debug("out : %u  in : %u", pid_out, pid_in);
-      }
+  ProcessList *process_list =
+    guicontrolflow_get_process_list(control_flow_data);
+  
+  guint pid_in;
+  {
+    guint pid_out;
+    LttField *f = ltt_event_field(e);
+    LttField *element;
+    element = ltt_field_member(f,0);
+    pid_out = ltt_event_get_long_unsigned(e,element);
+    element = ltt_field_member(f,1);
+    pid_in = ltt_event_get_long_unsigned(e,element);
+    g_debug("out : %u  in : %u", pid_out, pid_in);
+  }
 
 
-      /* Find process pid_in in the list... */
-      process_in = lttv_state_find_process(tfs, pid_in);
-      /* It should exist, because we are after the state update. */
-      g_assert(process_in != NULL);
+  /* Find process pid_in in the list... */
+  process_in = lttv_state_find_process(tfs, pid_in);
+  /* It should exist, because we are after the state update. */
+  g_assert(process_in != NULL);
 
-      birth = process_in->creation_time;
-      const gchar *name = g_quark_to_string(process_in->name);
+  birth = process_in->creation_time;
+  const gchar *name = g_quark_to_string(process_in->name);
 
-      if(processlist_get_process_pixels(process_list,
-              pid_in,
-              process_in->last_cpu,
-              &birth,
-              tfc->t_context->index,
-              &y_in,
-              &height,
-              &hashed_process_data_in) == 1)
-      {
-        g_assert(pid_in == 0 || pid_in != process_in->ppid);
-        /* Process not present */
-        processlist_add(process_list,
+  if(processlist_get_process_pixels(process_list,
+          pid_in,
+          process_in->last_cpu,
+          &birth,
+          tfc->t_context->index,
+          &y_in,
+          &height,
+          &hashed_process_data_in) == 1)
+  {
+    g_assert(pid_in == 0 || pid_in != process_in->ppid);
+    /* Process not present */
+    processlist_add(process_list,
+        pid_in,
+        process_in->last_cpu,
+        process_in->ppid,
+        &birth,
+        tfc->t_context->index,
+        name,
+        &pl_height,
+        &hashed_process_data_in);
+    processlist_get_process_pixels(process_list,
             pid_in,
             process_in->last_cpu,
-            process_in->ppid,
             &birth,
             tfc->t_context->index,
-            name,
-            &pl_height,
+            &y_in,
+            &height,
             &hashed_process_data_in);
-        processlist_get_process_pixels(process_list,
-                pid_in,
-                process_in->last_cpu,
-                &birth,
-                tfc->t_context->index,
-                &y_in,
-                &height,
-                &hashed_process_data_in);
-        drawing_insert_square( control_flow_data->drawing, y_in, height);
-      }
-
-      convert_time_to_pixels(
-          time_window.start_time,
-          end_time,
-          evtime,
-          width,
-          &hashed_process_data_in->x.middle);
-    }
+    drawing_insert_square( control_flow_data->drawing, y_in, height);
   }
+
+  convert_time_to_pixels(
+      time_window.start_time,
+      end_time,
+      evtime,
+      width,
+      &hashed_process_data_in->x.middle);
   return 0;
 
 
@@ -1842,115 +1832,106 @@ int before_execmode_hook(void *hook_data, void *call_data)
 
   guint width = drawing->width;
 
-  if(strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"syscall_entry") == 0
-   ||strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"syscall_exit") == 0
-   ||strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"trap_entry") == 0
-   ||strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"trap_exit") == 0
-   ||strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"irq_entry") == 0
-   ||strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"irq_exit") == 0
-   ) {
-
-    /* we are in a execmode, before the state update. We must draw the
-     * items corresponding to the state before it changes : now is the right
-     * time to do it.
-     */
-    /* For the pid */
-    LttvProcessState *process = tfs->process;
-    g_assert(process != NULL);
+  /* we are in a execmode, before the state update. We must draw the
+   * items corresponding to the state before it changes : now is the right
+   * time to do it.
+   */
+  /* For the pid */
+  LttvProcessState *process = tfs->process;
+  g_assert(process != NULL);
 
-    guint pid = process->pid;
+  guint pid = process->pid;
 
-    /* Well, the process_out existed : we must get it in the process hash
-     * or add it, and draw its items.
-     */
-     /* 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);
-    LttTime birth = process->creation_time;
-    const gchar *name = g_quark_to_string(process->name);
-    
-    if(processlist_get_process_pixels(process_list,
+  /* Well, the process_out existed : we must get it in the process hash
+   * or add it, and draw its items.
+   */
+   /* 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);
+  LttTime birth = process->creation_time;
+  const gchar *name = g_quark_to_string(process->name);
+  
+  if(processlist_get_process_pixels(process_list,
+          pid,
+          process->last_cpu,
+          &birth,
+          tfc->t_context->index,
+          &y,
+          &height,
+          &hashed_process_data) == 1)
+  {
+    g_assert(pid == 0 || pid != process->ppid);
+    /* Process not present */
+    processlist_add(process_list,
+        pid,
+        process->last_cpu,
+        process->ppid,
+        &birth,
+        tfc->t_context->index,
+        name,
+        &pl_height,
+        &hashed_process_data);
+    processlist_get_process_pixels(process_list,
             pid,
             process->last_cpu,
             &birth,
             tfc->t_context->index,
             &y,
             &height,
-            &hashed_process_data) == 1)
-    {
-      g_assert(pid == 0 || pid != process->ppid);
-      /* Process not present */
-      processlist_add(process_list,
-          pid,
-          process->last_cpu,
-          process->ppid,
-          &birth,
-          tfc->t_context->index,
-          name,
-          &pl_height,
-          &hashed_process_data);
-      processlist_get_process_pixels(process_list,
-              pid,
-              process->last_cpu,
-              &birth,
-              tfc->t_context->index,
-              &y,
-              &height,
-              &hashed_process_data);
-      drawing_insert_square( drawing, y, height);
-    }
-  
-    /* Now, the process is in the state hash and our own process hash.
-     * We definitely can draw the items related to the ending state.
-     */
-    
-    /* Check if the x position is unset. In can have been left unset by
-     * a draw closure from a after chunk hook. This should never happen,
-     * because it must be set by before chunk hook to the damage_begin
-     * value.
-     */
-    g_assert(hashed_process_data->x.over != -1);
-    {
-      guint x;
-      DrawContext draw_context;
-
-      convert_time_to_pixels(
-          time_window.start_time,
-          end_time,
-          evtime,
-          width,
-          &x);
+            &hashed_process_data);
+    drawing_insert_square( drawing, y, height);
+  }
 
-      /* Now create the drawing context that will be used to draw
-       * items related to the last state. */
-      draw_context.drawable = drawing->pixmap;
-      draw_context.gc = drawing->gc;
-      draw_context.pango_layout = drawing->pango_layout;
-      draw_context.drawinfo.start.x = hashed_process_data->x.over;
-      draw_context.drawinfo.end.x = x;
+  /* Now, the process is in the state hash and our own process hash.
+   * We definitely can draw the items related to the ending state.
+   */
+  
+  /* Check if the x position is unset. In can have been left unset by
+   * a draw closure from a after chunk hook. This should never happen,
+   * because it must be set by before chunk hook to the damage_begin
+   * value.
+   */
+  g_assert(hashed_process_data->x.over != -1);
+  {
+    guint x;
+    DrawContext draw_context;
 
-      draw_context.drawinfo.y.over = y+1;
-      draw_context.drawinfo.y.middle = y+(height/2);
-      draw_context.drawinfo.y.under = y+height;
+    convert_time_to_pixels(
+        time_window.start_time,
+        end_time,
+        evtime,
+        width,
+        &x);
 
-      draw_context.drawinfo.start.offset.over = 0;
-      draw_context.drawinfo.start.offset.middle = 0;
-      draw_context.drawinfo.start.offset.under = 0;
-      draw_context.drawinfo.end.offset.over = 0;
-      draw_context.drawinfo.end.offset.middle = 0;
-      draw_context.drawinfo.end.offset.under = 0;
+    /* Now create the drawing context that will be used to draw
+     * items related to the last state. */
+    draw_context.drawable = drawing->pixmap;
+    draw_context.gc = drawing->gc;
+    draw_context.pango_layout = drawing->pango_layout;
+    draw_context.drawinfo.start.x = hashed_process_data->x.over;
+    draw_context.drawinfo.end.x = x;
+
+    draw_context.drawinfo.y.over = y+1;
+    draw_context.drawinfo.y.middle = y+(height/2);
+    draw_context.drawinfo.y.under = y+height;
+
+    draw_context.drawinfo.start.offset.over = 0;
+    draw_context.drawinfo.start.offset.middle = 0;
+    draw_context.drawinfo.start.offset.under = 0;
+    draw_context.drawinfo.end.offset.over = 0;
+    draw_context.drawinfo.end.offset.middle = 0;
+    draw_context.drawinfo.end.offset.under = 0;
 
-      {
-        /* Draw the line */
-        PropertiesLine prop_line = prepare_execmode_line(process);
-        draw_line((void*)&prop_line, (void*)&draw_context);
+    {
+      /* Draw the line */
+      PropertiesLine prop_line = prepare_execmode_line(process);
+      draw_line((void*)&prop_line, (void*)&draw_context);
 
-      }
-      /* become the last x position */
-      hashed_process_data->x.over = x;
     }
+    /* become the last x position */
+    hashed_process_data->x.over = x;
   }
   
   return 0;
@@ -1992,76 +1973,63 @@ int after_execmode_hook(void *hook_data, void *call_data)
 
   guint width = control_flow_data->drawing->width;
 
-  if(strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"syscall_entry") == 0
-   ||strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"syscall_exit") == 0
-   ||strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"trap_entry") == 0
-   ||strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"trap_exit") == 0
-   ||strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"irq_entry") == 0
-   ||strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"irq_exit") == 0
-   ) {
-
-    g_debug("execmode!");
-    
-    {
-      /* Add process to process list (if not present) */
-      LttvProcessState *process;
-      LttTime birth;
-      guint y = 0, height = 0, pl_height = 0;
-      HashedProcessData *hashed_process_data = NULL;
+  /* Add process to process list (if not present) */
+  LttvProcessState *process;
+  LttTime birth;
+  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 =
+    guicontrolflow_get_process_list(control_flow_data);
+  
 
-      /* Find process pid_in in the list... */
-      process = tfs->process;
-      /* It should exist, because we are after the state update. */
-      g_assert(process != NULL);
+  /* Find process pid_in in the list... */
+  process = tfs->process;
+  /* It should exist, because we are after the state update. */
+  g_assert(process != NULL);
 
-      guint pid = process->pid;
+  guint pid = process->pid;
 
-      birth = process->creation_time;
-      const gchar *name = g_quark_to_string(process->name);
+  birth = process->creation_time;
+  const gchar *name = g_quark_to_string(process->name);
 
-      if(processlist_get_process_pixels(process_list,
-              pid,
-              process->last_cpu,
-              &birth,
-              tfc->t_context->index,
-              &y,
-              &height,
-              &hashed_process_data) == 1)
-      {
-        g_assert(pid == 0 || pid != process->ppid);
-        /* Process not present */
-        processlist_add(process_list,
+  if(processlist_get_process_pixels(process_list,
+          pid,
+          process->last_cpu,
+          &birth,
+          tfc->t_context->index,
+          &y,
+          &height,
+          &hashed_process_data) == 1)
+  {
+    g_assert(pid == 0 || pid != process->ppid);
+    /* Process not present */
+    processlist_add(process_list,
+        pid,
+        process->last_cpu,
+        process->ppid,
+        &birth,
+        tfc->t_context->index,
+        name,
+        &pl_height,
+        &hashed_process_data);
+    processlist_get_process_pixels(process_list,
             pid,
             process->last_cpu,
-            process->ppid,
             &birth,
             tfc->t_context->index,
-            name,
-            &pl_height,
+            &y,
+            &height,
             &hashed_process_data);
-        processlist_get_process_pixels(process_list,
-                pid,
-                process->last_cpu,
-                &birth,
-                tfc->t_context->index,
-                &y,
-                &height,
-                &hashed_process_data);
-        drawing_insert_square( control_flow_data->drawing, y, height);
-      }
-
-      convert_time_to_pixels(
-          time_window.start_time,
-          end_time,
-          evtime,
-          width,
-          &hashed_process_data->x.over);
-    }
+    drawing_insert_square( control_flow_data->drawing, y, height);
   }
+
+  convert_time_to_pixels(
+      time_window.start_time,
+      end_time,
+      evtime,
+      width,
+      &hashed_process_data->x.over);
   return 0;
 }
 
@@ -2104,117 +2072,112 @@ int before_process_hook(void *hook_data, void *call_data)
 
   guint width = control_flow_data->drawing->width;
 
-  if(strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"process") == 0) {
-
-    guint sub_id;
-    {
-      LttField *f = ltt_event_field(e);
-      LttField *element;
-      element = ltt_field_member(f,0);
-      sub_id = ltt_event_get_long_unsigned(e,element);
-    }
+  guint sub_id;
+  {
+    LttField *f = ltt_event_field(e);
+    LttField *element;
+    element = ltt_field_member(f,0);
+    sub_id = ltt_event_get_long_unsigned(e,element);
+  }
 
-    if(sub_id == 3) { /* exit */
+  if(sub_id == 3) { /* exit */
 
-      /* Add process to process list (if not present) */
-      LttvProcessState *process = tfs->process;
-      guint pid = process->pid;
-      LttTime birth;
-      guint y = 0, height = 0, pl_height = 0;
-      HashedProcessData *hashed_process_data = NULL;
+    /* Add process to process list (if not present) */
+    LttvProcessState *process = tfs->process;
+    guint pid = process->pid;
+    LttTime birth;
+    guint y = 0, height = 0, pl_height = 0;
+    HashedProcessData *hashed_process_data = NULL;
 
-      ProcessList *process_list =
-        guicontrolflow_get_process_list(control_flow_data);
-      
-      g_assert(process != NULL);
+    ProcessList *process_list =
+      guicontrolflow_get_process_list(control_flow_data);
+    
+    g_assert(process != NULL);
 
-      birth = process->creation_time;
-      const gchar *name = g_quark_to_string(process->name);
+    birth = process->creation_time;
+    const gchar *name = g_quark_to_string(process->name);
 
-      if(processlist_get_process_pixels(process_list,
+    if(processlist_get_process_pixels(process_list,
+            pid,
+            process->last_cpu,
+            &birth,
+            tfc->t_context->index,
+            &y,
+            &height,
+            &hashed_process_data) == 1)
+    {
+      g_assert(pid == 0 || pid != process->ppid);
+      /* Process not present */
+      processlist_add(process_list,
+          pid,
+          process->last_cpu,
+          process->ppid,
+          &birth,
+          tfc->t_context->index,
+          name,
+          &pl_height,
+          &hashed_process_data);
+      processlist_get_process_pixels(process_list,
               pid,
               process->last_cpu,
               &birth,
               tfc->t_context->index,
               &y,
               &height,
-              &hashed_process_data) == 1)
-      {
-        g_assert(pid == 0 || pid != process->ppid);
-        /* Process not present */
-        processlist_add(process_list,
-            pid,
-            process->last_cpu,
-            process->ppid,
-            &birth,
-            tfc->t_context->index,
-            name,
-            &pl_height,
-            &hashed_process_data);
-        processlist_get_process_pixels(process_list,
-                pid,
-                process->last_cpu,
-                &birth,
-                tfc->t_context->index,
-                &y,
-                &height,
-                &hashed_process_data);
-        drawing_insert_square( control_flow_data->drawing, y, height);
-      }
+              &hashed_process_data);
+      drawing_insert_square( control_flow_data->drawing, y, height);
+    }
 
-      /* Now, the process is in the state hash and our own process hash.
-       * We definitely can draw the items related to the ending state.
-       */
-      
-      /* Check if the x position is unset. In can have been left unset by
-       * a draw closure from a after chunk hook. This should never happen,
-       * because it must be set by before chunk hook to the damage_begin
-       * value.
-       */
-      g_assert(hashed_process_data->x.over != -1);
-      {
-        guint x;
-        DrawContext draw_context;
+    /* Now, the process is in the state hash and our own process hash.
+     * We definitely can draw the items related to the ending state.
+     */
+    
+    /* Check if the x position is unset. In can have been left unset by
+     * a draw closure from a after chunk hook. This should never happen,
+     * because it must be set by before chunk hook to the damage_begin
+     * value.
+     */
+    g_assert(hashed_process_data->x.over != -1);
+    {
+      guint x;
+      DrawContext draw_context;
 
-        convert_time_to_pixels(
-            time_window.start_time,
-            end_time,
-            evtime,
-            width,
-            &x);
+      convert_time_to_pixels(
+          time_window.start_time,
+          end_time,
+          evtime,
+          width,
+          &x);
 
-        /* Now create the drawing context that will be used to draw
-         * items related to the last state. */
-        draw_context.drawable = drawing->pixmap;
-        draw_context.gc = drawing->gc;
-        draw_context.pango_layout = drawing->pango_layout;
-        draw_context.drawinfo.start.x = hashed_process_data->x.middle;
-        draw_context.drawinfo.end.x = x;
+      /* Now create the drawing context that will be used to draw
+       * items related to the last state. */
+      draw_context.drawable = drawing->pixmap;
+      draw_context.gc = drawing->gc;
+      draw_context.pango_layout = drawing->pango_layout;
+      draw_context.drawinfo.start.x = hashed_process_data->x.middle;
+      draw_context.drawinfo.end.x = x;
 
-        draw_context.drawinfo.y.over = y+1;
-        draw_context.drawinfo.y.middle = y+(height/2);
-        draw_context.drawinfo.y.under = y+height;
+      draw_context.drawinfo.y.over = y+1;
+      draw_context.drawinfo.y.middle = y+(height/2);
+      draw_context.drawinfo.y.under = y+height;
 
-        draw_context.drawinfo.start.offset.over = 0;
-        draw_context.drawinfo.start.offset.middle = 0;
-        draw_context.drawinfo.start.offset.under = 0;
-        draw_context.drawinfo.end.offset.over = 0;
-        draw_context.drawinfo.end.offset.middle = 0;
-        draw_context.drawinfo.end.offset.under = 0;
+      draw_context.drawinfo.start.offset.over = 0;
+      draw_context.drawinfo.start.offset.middle = 0;
+      draw_context.drawinfo.start.offset.under = 0;
+      draw_context.drawinfo.end.offset.over = 0;
+      draw_context.drawinfo.end.offset.middle = 0;
+      draw_context.drawinfo.end.offset.under = 0;
 
-        {
-          /* Draw the line */
-          PropertiesLine prop_line = prepare_status_line(process);
-          draw_line((void*)&prop_line, (void*)&draw_context);
+      {
+        /* Draw the line */
+        PropertiesLine prop_line = prepare_status_line(process);
+        draw_line((void*)&prop_line, (void*)&draw_context);
 
-        }
-        /* become the last x position */
-        hashed_process_data->x.middle = x;
       }
-
+      /* become the last x position */
+      hashed_process_data->x.middle = x;
     }
 
-
   }
   return 0;
 
@@ -2262,143 +2225,138 @@ int after_process_hook(void *hook_data, void *call_data)
 
   guint width = control_flow_data->drawing->width;
 
-  if(strcmp(ltt_eventtype_name(ltt_event_eventtype(e)),"process") == 0) {
+  guint sub_id;
+  guint param1;
+  {
+    LttField *f = ltt_event_field(e);
+    LttField *element;
+    element = ltt_field_member(f,0);
+    sub_id = ltt_event_get_long_unsigned(e,element);
+    element = ltt_field_member(f,1);
+    param1 = ltt_event_get_long_unsigned(e,element);
+  }
 
-    guint sub_id;
-    guint param1;
-    {
-      LttField *f = ltt_event_field(e);
-      LttField *element;
-      element = ltt_field_member(f,0);
-      sub_id = ltt_event_get_long_unsigned(e,element);
-      element = ltt_field_member(f,1);
-      param1 = ltt_event_get_long_unsigned(e,element);
-    }
+  if(sub_id == 2) { /* fork */
+    
+    guint child_pid = param1;
+    /* Add process to process list (if not present) */
+    LttvProcessState *process_child;
+    LttTime birth;
+    guint y_child = 0, height = 0, pl_height = 0;
+    HashedProcessData *hashed_process_data_child = NULL;
 
-    if(sub_id == 2) { /* fork */
-      
-      guint child_pid = param1;
-      /* Add process to process list (if not present) */
-      LttvProcessState *process_child;
-      LttTime birth;
-      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 =
+      guicontrolflow_get_process_list(control_flow_data);
+    
 
-      /* Find child in the list... */
-      process_child = lttv_state_find_process(tfs, child_pid);
-      /* It should exist, because we are after the state update. */
-      g_assert(process_child != NULL);
+    /* Find child in the list... */
+    process_child = lttv_state_find_process(tfs, child_pid);
+    /* It should exist, because we are after the state update. */
+    g_assert(process_child != NULL);
 
-      birth = process_child->creation_time;
-      const gchar *name = g_quark_to_string(process_child->name);
+    birth = process_child->creation_time;
+    const gchar *name = g_quark_to_string(process_child->name);
 
-      if(processlist_get_process_pixels(process_list,
+    if(processlist_get_process_pixels(process_list,
+            child_pid,
+            process_child->last_cpu,
+            &birth,
+            tfc->t_context->index,
+            &y_child,
+            &height,
+            &hashed_process_data_child) == 1)
+    {
+      g_assert(child_pid == 0 || child_pid != process_child->ppid);
+      /* Process not present */
+      processlist_add(process_list,
+          child_pid,
+          process_child->last_cpu,
+          process_child->ppid,
+          &birth,
+          tfc->t_context->index,
+          name,
+          &pl_height,
+          &hashed_process_data_child);
+      processlist_get_process_pixels(process_list,
               child_pid,
               process_child->last_cpu,
               &birth,
               tfc->t_context->index,
               &y_child,
               &height,
-              &hashed_process_data_child) == 1)
-      {
-        g_assert(child_pid == 0 || child_pid != process_child->ppid);
-        /* Process not present */
-        processlist_add(process_list,
-            child_pid,
-            process_child->last_cpu,
-            process_child->ppid,
-            &birth,
-            tfc->t_context->index,
-            name,
-            &pl_height,
-            &hashed_process_data_child);
-        processlist_get_process_pixels(process_list,
-                child_pid,
-                process_child->last_cpu,
-                &birth,
-                tfc->t_context->index,
-                &y_child,
-                &height,
-                &hashed_process_data_child);
-        drawing_insert_square( control_flow_data->drawing, y_child, height);
-      }
+              &hashed_process_data_child);
+      drawing_insert_square( control_flow_data->drawing, y_child, height);
+    }
 
-      guint new_x;
-      convert_time_to_pixels(
-          time_window.start_time,
-          end_time,
-          evtime,
-          width,
-          &new_x);
-      hashed_process_data_child->x.over = new_x;
-      hashed_process_data_child->x.middle = new_x;
-      hashed_process_data_child->x.under = new_x;
+    guint new_x;
+    convert_time_to_pixels(
+        time_window.start_time,
+        end_time,
+        evtime,
+        width,
+        &new_x);
+    hashed_process_data_child->x.over = new_x;
+    hashed_process_data_child->x.middle = new_x;
+    hashed_process_data_child->x.under = new_x;
 
-    } else if(sub_id == 3) { /* exit */
+  } else if(sub_id == 3) { /* exit */
 
-      /* Add process to process list (if not present) */
-      LttvProcessState *process = tfs->process;
-      guint pid = process->pid;
-      LttTime birth;
-      guint y = 0, height = 0, pl_height = 0;
-      HashedProcessData *hashed_process_data = NULL;
+    /* Add process to process list (if not present) */
+    LttvProcessState *process = tfs->process;
+    guint pid = process->pid;
+    LttTime birth;
+    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 =
+      guicontrolflow_get_process_list(control_flow_data);
+    
 
-      /* It should exist, because we are after the state update. */
-      g_assert(process != NULL);
+    /* It should exist, because we are after the state update. */
+    g_assert(process != NULL);
 
-      birth = process->creation_time;
-      const gchar *name = g_quark_to_string(process->name);
+    birth = process->creation_time;
+    const gchar *name = g_quark_to_string(process->name);
 
-      if(processlist_get_process_pixels(process_list,
+    if(processlist_get_process_pixels(process_list,
+            pid,
+            process->last_cpu,
+            &birth,
+            tfc->t_context->index,
+            &y,
+            &height,
+            &hashed_process_data) == 1)
+    {
+      g_assert(pid == 0 || pid != process->ppid);
+      /* Process not present */
+      processlist_add(process_list,
+          pid,
+          process->last_cpu,
+          process->ppid,
+          &birth,
+          tfc->t_context->index,
+          name,
+          &pl_height,
+          &hashed_process_data);
+      processlist_get_process_pixels(process_list,
               pid,
               process->last_cpu,
               &birth,
               tfc->t_context->index,
               &y,
               &height,
-              &hashed_process_data) == 1)
-      {
-        g_assert(pid == 0 || pid != process->ppid);
-        /* Process not present */
-        processlist_add(process_list,
-            pid,
-            process->last_cpu,
-            process->ppid,
-            &birth,
-            tfc->t_context->index,
-            name,
-            &pl_height,
-            &hashed_process_data);
-        processlist_get_process_pixels(process_list,
-                pid,
-                process->last_cpu,
-                &birth,
-                tfc->t_context->index,
-                &y,
-                &height,
-                &hashed_process_data);
-        drawing_insert_square( control_flow_data->drawing, y, height);
-      }
-
-      guint new_x;
-      convert_time_to_pixels(
-          time_window.start_time,
-          end_time,
-          evtime,
-          width,
-          &new_x);
-      hashed_process_data->x.middle = new_x;
+              &hashed_process_data);
+      drawing_insert_square( control_flow_data->drawing, y, height);
     }
 
-
+    guint new_x;
+    convert_time_to_pixels(
+        time_window.start_time,
+        end_time,
+        evtime,
+        width,
+        &new_x);
+    hashed_process_data->x.middle = new_x;
   }
   return 0;
 
index 40d184681eb7ce8a776fd9a1be6d18ea26e1c939..85f241486e4ae4ebcafaee048489d47ddee4f792 100644 (file)
@@ -1613,7 +1613,8 @@ void get_events(EventViewerData* event_viewer_data, LttTime start,
   events_request->end_time = ltt_time_infinite;
   events_request->num_events = max_num_events;
   events_request->end_position = NULL;
-  events_request->trace = 0;  /* FIXME */
+  events_request->trace = -1;  /* FIXME */
+  events_request->hooks = NULL;  /* FIXME */
   events_request->before_chunk_traceset = NULL;
   events_request->before_chunk_trace = NULL;
   events_request->before_chunk_tracefile = NULL;
index 0ef06eedbebc7449dee4c4257e71d173bd3d8184..2f42d26398a1051ede60d028fdf4a50828278ea6 100644 (file)
@@ -879,6 +879,8 @@ static void events_request_free(EventsRequest *events_request)
        lttv_traceset_context_position_destroy(events_request->start_position);
   if(events_request->end_position != NULL)
        lttv_traceset_context_position_destroy(events_request->end_position);
+  if(events_request->hooks != NULL)
+    g_array_free(events_request->hooks, TRUE);
   if(events_request->before_chunk_traceset != NULL)
        lttv_hooks_destroy(events_request->before_chunk_traceset);
   if(events_request->before_chunk_trace != NULL)
index e0a969a208fc05f0af43179045372bec3b26bb52..85ecb29c53501125538d0bceef036196588b8d74 100644 (file)
@@ -602,6 +602,7 @@ typedef struct _EventsRequest {
   guint                        num_events;      /* Unset : G_MAXUINT        */
   LttvTracesetContextPosition *end_position;    /* Unset : NULL             */
   gint                         trace;           /* unset : -1               */
+  GArray                      *hooks;           /* Unset : NULL             */
   LttvHooks                   *before_chunk_traceset; /* Unset : NULL       */
   LttvHooks                   *before_chunk_trace;    /* Unset : NULL       */
   LttvHooks                   *before_chunk_tracefile;/* Unset : NULL       */
This page took 0.043341 seconds and 4 git commands to generate.