quit menu complete
[lttv.git] / ltt / branches / poly / lttv / modules / gui / API / gtkTraceSet.c
index f53b068f0f8f241b7cf4fe971d6e358d7d67ef8f..336e1f8b21cdf49bdcf446cd7ca7335548e3565f 100644 (file)
@@ -18,6 +18,9 @@
 #include <lttv/processTrace.h>
 #include <lttv/toolbar.h>
 #include <lttv/menu.h>
+#include <lttv/state.h>
+#include <lttv/stats.h>
+
 
 /**
  * Internal function parts
@@ -575,9 +578,11 @@ void SetHPaneDividor(mainWindow *main_win, gint position)
  * @param end the end time of the last event to be processed.
  */
 
-void processTraceset(mainWindow *main_win, LttTime start, LttTime end)
+void processTraceset(mainWindow *main_win, LttTime start, 
+                    LttTime end, unsigned maxNumEvents)
 {
-  lttv_process_trace(start, end, main_win->traceset, main_win->traceset_context);
+  lttv_process_trace(start, end, main_win->traceset, 
+                    main_win->traceset_context,  maxNumEvents);
 }
 
 /**
@@ -636,3 +641,82 @@ void contextRemoveHooks(mainWindow *main_win ,
                                     check_tracefile,before_tracefile,after_tracefile,
                                     check_event,before_event, after_event);
 }
+
+
+/**
+ * Function to get the life span of the traceset
+ * @param main_win the main window the viewer belongs to.
+ * @param start start time of the traceset.
+ * @param end end time of the traceset.
+ */
+
+void getTracesetTimeSpan(mainWindow *main_win, LttTime * start, LttTime* end)
+{
+  LttvTraceset * traceset = main_win->traceset;
+  int numTraces = lttv_traceset_number(traceset);
+  int i;
+  LttTime s, e;
+  LttvTraceContext *tc;
+  LttTrace * trace;
+
+  for(i=0; i<numTraces;i++){
+    tc = main_win->traceset_context->traces[i];
+    trace = tc->t;
+
+    ltt_trace_time_span_get(trace, &s, &e);
+
+    if(i==0){
+      *start = s;
+      *end   = e;
+    }else{
+      if(s.tv_sec < start->tv_sec ||
+        (s.tv_sec == start->tv_sec && s.tv_nsec < start->tv_nsec))
+       *start = s;
+      if(e.tv_sec > end->tv_sec ||
+        (e.tv_sec == end->tv_sec && e.tv_nsec > end->tv_nsec))
+       *end = e;      
+    }
+  }
+}
+
+
+/**
+ * Function to add/remove event hooks for state 
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void stateAddEventHooks(mainWindow *main_win )
+{
+  lttv_state_add_event_hooks((LttvTracesetState*)main_win->traceset_context);
+}
+
+void stateRemoveEventHooks(mainWindow *main_win )
+{
+  lttv_state_remove_event_hooks((LttvTracesetState*)main_win->traceset_context);
+}
+
+
+/**
+ * Function to add/remove event hooks for stats 
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void statsAddEventHooks(mainWindow *main_win )
+{
+  lttv_stats_add_event_hooks((LttvTracesetStats*)main_win->traceset_context);
+}
+
+void statsRemoveEventHooks(mainWindow *main_win )
+{
+  lttv_stats_remove_event_hooks((LttvTracesetStats*)main_win->traceset_context);
+}
+
+/**
+ * Function to get the stats of the traceset 
+ * @param main_win the main window the viewer belongs to.
+ */
+
+LttvTracesetStats* getTracesetStats(mainWindow *main_win)
+{
+  return (LttvTracesetStats*)main_win->traceset_context;
+}
This page took 0.023769 seconds and 4 git commands to generate.