lttvwindow with per trace event delivery
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 12 Aug 2004 14:40:29 +0000 (14:40 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 12 Aug 2004 14:40:29 +0000 (14:40 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@712 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c
ltt/branches/poly/lttv/modules/gui/controlflow/processlist.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 c504cf5bc53beda7b66383807a2f44dae12cd7c1..d1b631006bedd4fb0583642f5393396f7ac3d79d 100644 (file)
@@ -186,6 +186,7 @@ void drawing_data_request(Drawing_t *drawing,
   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;
@@ -483,7 +484,7 @@ after_expose_event( GtkWidget *widget, GdkEventExpose *event, gpointer user_data
 
 }
 
-
+#if 0
 void
 tree_row_activated(GtkTreeModel *treemodel,
                    GtkTreePath *arg1,
@@ -498,12 +499,12 @@ tree_row_activated(GtkTreeModel *treemodel,
   
   path_indices =  gtk_tree_path_get_indices (arg1);
 
-  height = get_cell_height(
+  height = get_cell_height(cfd->process_list,
         GTK_TREE_VIEW(treeview));
   drawing->horizontal_sel = height * path_indices[0];
   g_critical("new hor sel : %i", drawing->horizontal_sel);
 }
-
+#endif //0
 
 /* mouse click */
 static gboolean
index db29cb8dcdf113abd05a34f30e9675d8677e8060..0a29dfe1e9fa2109590d29ccfb96192d9a26996d 100644 (file)
@@ -434,7 +434,7 @@ GtkWidget *processlist_get_widget(ProcessList *process_list)
 
 
 
-__inline gint get_cell_height(ProcessList *process_list, GtkTreeView *tree_view)
+static __inline gint get_cell_height(ProcessList *process_list, GtkTreeView *tree_view)
 {
   gint height = process_list->cell_height_cache;
   if(height != -1) return height;
index 414a311b297e96cc842e88b16c0f0dc8ef77e819..40d184681eb7ce8a776fd9a1be6d18ea26e1c939 100644 (file)
@@ -700,7 +700,7 @@ void v_scroll_cb (GtkAdjustment *adjustment, gpointer data)
     }
 }
 
-gint get_cell_height(GtkTreeView *TreeView)
+static __inline gint get_cell_height(GtkTreeView *TreeView)
 {
   gint height;
   GtkTreeViewColumn *column = gtk_tree_view_get_column(TreeView, 0);
@@ -1613,6 +1613,7 @@ 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->before_chunk_traceset = NULL;
   events_request->before_chunk_trace = NULL;
   events_request->before_chunk_tracefile = NULL;
index 12b54c0be9a6316fef234384ae10b4d3a492b39f..0ef06eedbebc7449dee4c4257e71d173bd3d8184 100644 (file)
@@ -1223,11 +1223,27 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
           /* 1.3.2 call before chunk
            * 1.3.3 events hooks added
            */
-          lttv_process_traceset_begin(tsc, events_request->before_chunk_traceset,
-                                           events_request->before_chunk_trace,
-                                           events_request->before_chunk_tracefile,
-                                           events_request->event,
-                                           events_request->event_by_id);
+          if(events_request->trace == -1)
+            lttv_process_traceset_begin(tsc,
+                events_request->before_chunk_traceset,
+                events_request->before_chunk_trace,
+                events_request->before_chunk_tracefile,
+                events_request->event,
+                events_request->event_by_id);
+          else {
+            guint nb_trace = lttv_traceset_number(tsc->ts);
+            g_assert(events_request->trace < nb_trace &&
+                      events_request->trace > -1);
+            LttvTraceContext *tc = tsc->traces[events_request->trace];
+
+            lttv_hooks_call(events_request->before_chunk_traceset, tsc);
+
+            lttv_trace_context_add_hooks(tc,
+                                         events_request->before_chunk_trace,
+                                         events_request->before_chunk_tracefile,
+                                         events_request->event,
+                                         events_request->event_by_id);
+          }
         }
       }
     } else {
@@ -1244,11 +1260,27 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
           /* - Call before chunk
            * - events hooks added
            */
-          lttv_process_traceset_begin(tsc, events_request->before_chunk_traceset,
+          if(events_request->trace == -1)
+            lttv_process_traceset_begin(tsc,
+                events_request->before_chunk_traceset,
+                events_request->before_chunk_trace,
+                events_request->before_chunk_tracefile,
+                events_request->event,
+                events_request->event_by_id);
+          else {
+            guint nb_trace = lttv_traceset_number(tsc->ts);
+            g_assert(events_request->trace < nb_trace &&
+                      events_request->trace > -1);
+            LttvTraceContext *tc = tsc->traces[events_request->trace];
+
+            lttv_hooks_call(events_request->before_chunk_traceset, tsc);
+
+            lttv_trace_context_add_hooks(tc,
                                          events_request->before_chunk_trace,
                                          events_request->before_chunk_tracefile,
                                          events_request->event,
                                          events_request->event_by_id);
+          }
 
           iter = g_slist_next(iter);
         }
@@ -1292,11 +1324,29 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
             /* call before chunk
              * events hooks added
              */
-            lttv_process_traceset_begin(tsc, events_request->before_chunk_traceset,
-                                             events_request->before_chunk_trace,
-                                             events_request->before_chunk_tracefile,
-                                             events_request->event,
-                                             events_request->event_by_id);
+            if(events_request->trace == -1)
+              lttv_process_traceset_begin(tsc,
+                  events_request->before_chunk_traceset,
+                  events_request->before_chunk_trace,
+                  events_request->before_chunk_tracefile,
+                  events_request->event,
+                  events_request->event_by_id);
+            else {
+              guint nb_trace = lttv_traceset_number(tsc->ts);
+              g_assert(events_request->trace < nb_trace &&
+                        events_request->trace > -1);
+              LttvTraceContext *tc = tsc->traces[events_request->trace];
+
+              lttv_hooks_call(events_request->before_chunk_traceset, tsc);
+
+              lttv_trace_context_add_hooks(tc,
+                                           events_request->before_chunk_trace,
+                                           events_request->before_chunk_tracefile,
+                                           events_request->event,
+                                           events_request->event_by_id);
+          }
+
+
           }
 
           /* Go to next */
@@ -1426,11 +1476,31 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
           /* - Remove events hooks for req
            * - Call end chunk for req
            */
-          lttv_process_traceset_end(tsc, events_request->after_chunk_traceset,
+
+          if(events_request->trace == -1) 
+               lttv_process_traceset_end(tsc,
+                                         events_request->after_chunk_traceset,
                                          events_request->after_chunk_trace,
                                          events_request->after_chunk_tracefile,
                                          events_request->event,
                                          events_request->event_by_id);
+
+          else {
+            guint nb_trace = lttv_traceset_number(tsc->ts);
+            g_assert(events_request->trace < nb_trace &&
+                      events_request->trace > -1);
+            LttvTraceContext *tc = tsc->traces[events_request->trace];
+
+            lttv_trace_context_remove_hooks(tc,
+                                         events_request->after_chunk_trace,
+                                         events_request->after_chunk_tracefile,
+                                         events_request->event,
+                                         events_request->event_by_id);
+            lttv_hooks_call(events_request->after_chunk_traceset, tsc);
+
+
+          }
+
           /* - Call end request for req */
           lttv_hooks_call(events_request->after_request, (gpointer)tsc);
           
@@ -1465,12 +1535,29 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
           /* - Remove events hooks for req
            * - Call end chunk for req
            */
-          lttv_process_traceset_end(tsc, events_request->after_chunk_traceset,
+          if(events_request->trace == -1) 
+               lttv_process_traceset_end(tsc,
+                                         events_request->after_chunk_traceset,
                                          events_request->after_chunk_trace,
                                          events_request->after_chunk_tracefile,
                                          events_request->event,
                                          events_request->event_by_id);
 
+          else {
+            guint nb_trace = lttv_traceset_number(tsc->ts);
+            g_assert(events_request->trace < nb_trace &&
+                      events_request->trace > -1);
+            LttvTraceContext *tc = tsc->traces[events_request->trace];
+
+            lttv_trace_context_remove_hooks(tc,
+                                         events_request->after_chunk_trace,
+                                         events_request->after_chunk_tracefile,
+                                         events_request->event,
+                                         events_request->event_by_id);
+
+            lttv_hooks_call(events_request->after_chunk_traceset, tsc);
+          }
+
           /* - req.num -= count */
           g_assert(events_request->num_events >= count);
           events_request->num_events -= count;
index 18e5853e0481853811987b09441aed082e2fb021..e0a969a208fc05f0af43179045372bec3b26bb52 100644 (file)
@@ -601,6 +601,7 @@ typedef struct _EventsRequest {
   LttTime                      end_time;        /* Unset : ltt_time_infinite*/
   guint                        num_events;      /* Unset : G_MAXUINT        */
   LttvTracesetContextPosition *end_position;    /* Unset : NULL             */
+  gint                         trace;           /* unset : -1               */
   LttvHooks                   *before_chunk_traceset; /* Unset : NULL       */
   LttvHooks                   *before_chunk_trace;    /* Unset : NULL       */
   LttvHooks                   *before_chunk_tracefile;/* Unset : NULL       */
This page took 0.037243 seconds and 4 git commands to generate.