Add member timestamp and cpuid to LttvTracesetPosition to improve the comparaison...
[lttv.git] / lttv / modules / gui / lttvwindow / lttvwindow / lttvwindow.c
index ebbaa06fd37fdeb050237b779238d2de4660136e..9d42fc88e807afcf87b8d5c88e6b4b94bd862e8b 100644 (file)
 #include <ltt/ltt.h>
 #include <lttv/lttv.h>
 #include <lttv/state.h>
+#include <lttv/traceset.h>
+#ifdef BABEL_CLEANUP
 #include <lttv/stats.h>
-#include <lttv/tracecontext.h>
+#endif /* BABEL_CLEANUP */
 #include <lttvwindow/mainwindow.h>   
-#include <lttvwindow/mainwindow-private.h>   
+#include <lttvwindow/mainwindow-private.h>
 #include <lttvwindow/lttvwindow.h>
 #include <lttvwindow/toolbar.h>
 #include <lttvwindow/menu.h>
@@ -65,6 +67,7 @@ void set_time_window(Tab *tab, const TimeWindow *time_window)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
+  gboolean retval;
 
   TimeWindowNotifyData time_window_notify_data;
   TimeWindow old_time_window = tab->time_window;
@@ -73,8 +76,9 @@ void set_time_window(Tab *tab, const TimeWindow *time_window)
   time_window_notify_data.new_time_window = 
                           &(tab->time_window);
 
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetimewindow", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetimewindow", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp != NULL) lttv_hooks_call(tmp, &time_window_notify_data);
 
@@ -94,11 +98,13 @@ void set_current_time(Tab *tab, const LttTime *current_time)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
+  gboolean retval;
 
   tab->current_time = *current_time;
 
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrenttime", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrenttime", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp != NULL) lttv_hooks_call(tmp, &tab->current_time);
 }
@@ -111,17 +117,21 @@ void set_current_time(Tab *tab, const LttTime *current_time)
  * This is called whenever the current time value changes.
  */
 
-void set_current_position(Tab *tab, const LttvTracesetContextPosition *pos)
+void set_current_position(Tab *tab, const LttvTracesetPosition *pos)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
+  gboolean retval;
 
-  tab->current_time = lttv_traceset_context_position_get_time(pos);
+  tab->current_time = lttv_traceset_position_get_time(pos);
 
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrentposition", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrentposition", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
-  if(tmp != NULL) lttv_hooks_call(tmp, pos);
+  if (tmp != NULL) {
+    lttv_hooks_call(tmp, (void *) pos);
+  }
 }
 
 void add_toolbar_constructor(MainWindow *mw, LttvToolbarClosure *toolbar_c)
@@ -132,9 +142,11 @@ void add_toolbar_constructor(MainWindow *mw, LttvToolbarClosure *toolbar_c)
   lttvwindow_viewer_constructor constructor;
   GtkWidget * tool_menu_title_menu, *new_widget, *pixmap;
   GdkPixbuf *pixbuf;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-          "viewers/toolbar", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/toolbar",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_toolbars_new();
   instance_toolbar = (LttvToolbars*)*(value.v_pointer);
@@ -176,9 +188,11 @@ void add_menu_constructor(MainWindow *mw, LttvMenuClosure *menu_c)
   LttvToolbars * instance_menu;
   lttvwindow_viewer_constructor constructor;
   GtkWidget * tool_menu_title_menu, *new_widget;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-          "viewers/menu", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/menu",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_menus_new();
   instance_menu = (LttvMenus*)*(value.v_pointer);
@@ -206,9 +220,11 @@ void remove_toolbar_constructor(MainWindow *mw, lttvwindow_viewer_constructor vi
   LttvAttributeValue value;
   LttvToolbars * instance_toolbar;
   GtkWidget * tool_menu_title_menu, *widget;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-          "viewers/toolbar", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/toolbar",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_toolbars_new();
   instance_toolbar = (LttvToolbars*)*(value.v_pointer);
@@ -226,9 +242,11 @@ void remove_menu_constructor(MainWindow *mw, lttvwindow_viewer_constructor viewe
   LttvAttributeValue value;
   LttvMenus * instance_menu;
   GtkWidget * tool_menu_title_menu, *widget;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-          "viewers/menu", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/menu",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_menus_new();
   instance_menu = (LttvMenus*)*(value.v_pointer);
@@ -274,12 +292,14 @@ __EXPORT void lttvwindow_register_constructor
   LttvToolbarClosure toolbar_c;
   LttvMenuClosure menu_c;
   LttvAttributeValue value;
+  gboolean retval;
 
   if(view_constructor == NULL) return;
   
   if(pixmap != NULL) {
-    g_assert(lttv_iattribute_find_by_path(attributes_global,
-       "viewers/toolbar", LTTV_POINTER, &value));
+    retval= lttv_iattribute_find_by_path(attributes_global, "viewers/toolbar",
+      LTTV_POINTER, &value);
+    g_assert(retval);
     toolbar = (LttvToolbars*)*(value.v_pointer);
 
     if(toolbar == NULL) {
@@ -295,8 +315,9 @@ __EXPORT void lttvwindow_register_constructor
   }
 
   if(menu_path != NULL) {
-    g_assert(lttv_iattribute_find_by_path(attributes_global,
-       "viewers/menu", LTTV_POINTER, &value));
+    retval= lttv_iattribute_find_by_path(attributes_global, "viewers/menu",
+      LTTV_POINTER, &value);
+    g_assert(retval);
     menu = (LttvMenus*)*(value.v_pointer);
     
     if(menu == NULL) {
@@ -346,10 +367,12 @@ __EXPORT void lttvwindow_unregister_constructor
   LttvToolbars * toolbar;
   LttvMenus * menu;
   LttvAttributeValue value;
-       gboolean is_named;
+  gboolean is_named;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes_global,
-     "viewers/toolbar", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes_global, "viewers/toolbar",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   toolbar = (LttvToolbars*)*(value.v_pointer);
   
   if(toolbar != NULL) {
@@ -359,8 +382,9 @@ __EXPORT void lttvwindow_unregister_constructor
     lttv_toolbars_remove(toolbar, view_constructor);
   }
 
-  g_assert(lttv_iattribute_find_by_path(attributes_global,
-     "viewers/menu", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes_global, "viewers/menu",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   menu = (LttvMenus*)*(value.v_pointer);
   
   if(menu != NULL) {
@@ -408,8 +432,11 @@ __EXPORT void lttvwindow_register_time_window_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetimewindow", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetimewindow", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -432,8 +459,58 @@ __EXPORT void lttvwindow_unregister_time_window_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetimewindow", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetimewindow", LTTV_POINTER, &value);
+  g_assert(retval);
+  tmp = (LttvHooks*)*(value.v_pointer);
+  if(tmp == NULL) return;
+  lttv_hooks_remove_data(tmp, hook, hook_data);
+}
+
+/**
+ * Function to register a hook function for a viewer to set/update its
+ * allowed time span.
+ * @param tab viewer's tab 
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+__EXPORT void lttvwindow_register_timespan_notify(Tab *tab,
+    LttvHook hook, gpointer hook_data)
+{
+  LttvAttributeValue value;
+  LttvHooks * tmp;
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetimespan", LTTV_POINTER, &value);
+  g_assert(retval);
+  tmp = (LttvHooks*)*(value.v_pointer);
+  if(tmp == NULL){    
+    tmp = lttv_hooks_new();
+    *(value.v_pointer) = tmp;
+  }
+  lttv_hooks_add(tmp, hook,hook_data, LTTV_PRIO_DEFAULT);
+}
+/**
+ * Function to unregister a viewer's hook function which is used to 
+ * set/update the time span allowed for the viewer.
+ * @param tab viewer's tab 
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+
+__EXPORT void lttvwindow_unregister_timespan_notify(Tab *tab,
+    LttvHook hook, gpointer hook_data)
+{
+  LttvAttributeValue value;
+  LttvHooks * tmp;
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetimespan", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -452,8 +529,11 @@ __EXPORT void lttvwindow_register_traceset_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetraceset", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetraceset", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -476,8 +556,11 @@ __EXPORT void lttvwindow_unregister_traceset_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetraceset", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetraceset", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -496,8 +579,11 @@ __EXPORT void lttvwindow_register_redraw_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/redraw", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/redraw",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -520,8 +606,11 @@ __EXPORT void lttvwindow_unregister_redraw_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/redraw", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/redraw",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -546,8 +635,11 @@ __EXPORT void lttvwindow_register_continue_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/continue", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/continue",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -571,8 +663,11 @@ __EXPORT void lttvwindow_unregister_continue_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/continue", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/continue",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -592,8 +687,11 @@ __EXPORT void lttvwindow_register_filter_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatefilter", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/updatefilter",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -617,8 +715,11 @@ __EXPORT void lttvwindow_unregister_filter_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatefilter", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/updatefilter",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -637,8 +738,11 @@ __EXPORT void lttvwindow_register_current_time_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrenttime", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrenttime", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -661,8 +765,11 @@ __EXPORT void lttvwindow_unregister_current_time_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrenttime", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrenttime", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -681,8 +788,11 @@ __EXPORT void lttvwindow_register_current_position_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrentposition", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrentposition", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -705,8 +815,11 @@ __EXPORT void lttvwindow_unregister_current_position_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrentposition", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrentposition", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -726,8 +839,11 @@ void lttvwindow_register_show_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/showviewer", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/showviewer",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -750,8 +866,11 @@ void lttvwindow_unregister_show_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/showviewer", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/showviewer",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -770,8 +889,11 @@ void lttvwindow_register_dividor(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/hpanedividor", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/hpanedividor",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -795,8 +917,11 @@ void lttvwindow_unregister_dividor(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/hpanedividor", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/hpanedividor",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -885,7 +1010,7 @@ __EXPORT void lttvwindow_report_current_time(Tab *tab,
  */
 
 __EXPORT void lttvwindow_report_current_position(Tab *tab,
-                                        LttvTracesetContextPosition *pos)
+                                        LttvTracesetPosition *pos)
 {
   current_position_change_manager(tab, pos);
 }
@@ -903,8 +1028,11 @@ void lttvwindow_report_dividor(Tab *tab, gint position)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/hpanedividor", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/hpanedividor",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_call(tmp, &position);
@@ -1014,8 +1142,12 @@ __EXPORT gboolean lttvwindow_events_request_pending(Tab            *tab)
 {
   GSList *element = tab->events_requests;
 
-  if(element == NULL) return FALSE;
-  else return TRUE;
+  if(element == NULL){
+          return FALSE;
+  }
+  else {
+          return TRUE;
+  }
 }
 
 
@@ -1075,18 +1207,20 @@ void lttvwindow_report_filter(Tab *tab, LttvFilter *filter)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
+  gboolean retval;
 
   //lttv_filter_destroy(tab->filter);
   //tab->filter = filter;
   
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatefilter", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/updatefilter",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_call(tmp, filter);
 }
 
-
+#ifdef BABEL_CLEANUP
 
 /**
  * Function to get the stats of the traceset 
@@ -1097,26 +1231,32 @@ __EXPORT LttvTracesetStats* lttvwindow_get_traceset_stats(Tab *tab)
 {
   return tab->traceset_info->traceset_context;
 }
+#endif /*BABEL_CLEANUP*/
 
-__EXPORT LttvTracesetContext* lttvwindow_get_traceset_context(Tab *tab)
+__EXPORT LttvTraceset *lttvwindow_get_traceset(Tab *tab)
 {
-  return (LttvTracesetContext*)tab->traceset_info->traceset_context;
+        return tab->traceset_info->traceset;
 }
 
-
 void events_request_free(EventsRequest *events_request)
 {
   if(events_request == NULL) return;
 
   if(events_request->start_position != NULL)
-       lttv_traceset_context_position_destroy(events_request->start_position);
+       lttv_traceset_destroy_position(events_request->start_position);
   if(events_request->end_position != NULL)
-       lttv_traceset_context_position_destroy(events_request->end_position);
-  if(events_request->hooks != NULL) {
+       lttv_traceset_destroy_position(events_request->end_position);
+#ifdef BABEL_CLEANUP
+       if(events_request->hooks != NULL) {
     GArray *hooks = events_request->hooks;
+   
     lttv_trace_hook_remove_all(&hooks);
     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)
@@ -1125,8 +1265,6 @@ void events_request_free(EventsRequest *events_request)
        lttv_hooks_destroy(events_request->before_chunk_tracefile);
   if(events_request->event != NULL)
        lttv_hooks_destroy(events_request->event);
-  if(events_request->event_by_id_channel != NULL)
-       lttv_hooks_by_id_channel_destroy(events_request->event_by_id_channel);
   if(events_request->after_chunk_tracefile != NULL)
        lttv_hooks_destroy(events_request->after_chunk_tracefile);
   if(events_request->after_chunk_trace != NULL)
@@ -1137,10 +1275,11 @@ void events_request_free(EventsRequest *events_request)
        lttv_hooks_destroy(events_request->before_request);
   if(events_request->after_request != NULL)
        lttv_hooks_destroy(events_request->after_request);
-
+#endif /*BABEL_CLEANUP*/
   g_free(events_request);
-}
 
+}
 
 
 __EXPORT GtkWidget *main_window_get_widget(Tab *tab)
This page took 0.029628 seconds and 4 git commands to generate.