- * @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;
- }
- }
+ */
+
+void state_add_event_hooks_api(MainWindow *main_win )
+{
+ lttv_state_add_event_hooks(
+ (LttvTracesetState*)main_win->current_tab->traceset_info->traceset_context);
+}
+
+void state_remove_event_hooks_api(MainWindow *main_win )
+{
+ lttv_state_remove_event_hooks(
+ (LttvTracesetState*)main_win->current_tab->traceset_info->traceset_context);
+}
+
+
+/**
+ * Function to add/remove event hooks for stats
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void stats_add_event_hooks_api(MainWindow *main_win )
+{
+ lttv_stats_add_event_hooks(
+ (LttvTracesetStats*)main_win->current_tab->traceset_info->traceset_context);
+}
+
+void stats_remove_event_hooks_api(MainWindow *main_win )
+{
+ lttv_stats_remove_event_hooks(
+ (LttvTracesetStats*)main_win->current_tab->traceset_info->traceset_context);
+}
+
+/**
+ * Function to get the stats of the traceset
+ * @param main_win the main window the viewer belongs to.
+ */
+
+LttvTracesetStats* get_traceset_stats_api(MainWindow *main_win)
+{
+ return main_win->current_tab->traceset_info->traceset_context;