1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2003-2004 XangXiu Yang
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 /*! \file lttvviewer.c
20 * \brief API used by the graphical viewers to interact with their top window.
22 * Main window (gui module) is the place to contain and display viewers.
23 * Viewers (lttv plugins) interacte with main window through this API and
25 * This header file should be included in each graphic module.
26 * This library is used by graphical modules to interact with the
31 #include <lttvwindow/common.h>
33 #include <lttv/lttv.h>
34 #include <lttvwindow/mainwindow.h>
35 #include <lttvwindow/viewer.h>
36 #include <lttv/tracecontext.h>
37 #include <lttvwindow/toolbar.h>
38 #include <lttvwindow/menu.h>
39 #include <lttv/state.h>
40 #include <lttv/stats.h>
44 * Internal function parts
48 * Function to set/update traceset for the viewers
49 * @param main_win main window
50 * @param traceset traceset of the main window.
53 void SetTraceset(MainWindow
* main_win
, gpointer traceset
)
56 LttvAttributeValue value
;
58 g_assert(lttv_iattribute_find_by_path(main_win
->attributes
,
59 "hooks/updatetraceset", LTTV_POINTER
, &value
));
60 tmp
= (LttvHooks
*)*(value
.v_pointer
);
61 if(tmp
== NULL
)return;
62 lttv_hooks_call(tmp
,traceset
);
67 * Function to set/update filter for the viewers
68 * @param main_win main window
69 * @param filter filter of the main window.
72 void SetFilter(MainWindow
* main_win
, gpointer filter
)
75 LttvAttributeValue value
;
77 g_assert(lttv_iattribute_find_by_path(main_win
->attributes
,
78 "hooks/updatefilter", LTTV_POINTER
, &value
));
79 tmp
= (LttvHooks
*)*(value
.v_pointer
);
81 if(tmp
== NULL
)return;
82 lttv_hooks_call(tmp
,filter
);
92 * Function to register a view constructor so that main window can generate
93 * a toolbar item for the viewer in order to generate a new instance easily.
94 * It will be called by init function of the module.
95 * @param ButtonPixmap image shown on the toolbar item.
96 * @param tooltip tooltip of the toolbar item.
97 * @param view_constructor constructor of the viewer.
100 void toolbar_item_reg(char ** pixmap
, char *tooltip
, lttv_constructor view_constructor
)
102 LttvIAttribute
*attributes_global
= LTTV_IATTRIBUTE(lttv_global_attributes());
103 LttvToolbars
* toolbar
;
104 LttvAttributeValue value
;
106 g_assert(lttv_iattribute_find_by_path(attributes_global
,
107 "viewers/toolbar", LTTV_POINTER
, &value
));
108 toolbar
= (LttvToolbars
*)*(value
.v_pointer
);
111 toolbar
= lttv_toolbars_new();
112 *(value
.v_pointer
) = toolbar
;
114 lttv_toolbars_add(toolbar
, view_constructor
, tooltip
, pixmap
);
119 * Function to unregister the viewer's constructor, release the space
120 * occupied by pixmap, tooltip and constructor of the viewer.
121 * It will be called when a module is unloaded.
122 * @param view_constructor constructor of the viewer which is used as
123 * a reference to find out where the pixmap and tooltip are.
126 void toolbar_item_unreg(lttv_constructor view_constructor
)
128 LttvIAttribute
*attributes_global
= LTTV_IATTRIBUTE(lttv_global_attributes());
129 LttvToolbars
* toolbar
;
130 LttvAttributeValue value
;
132 g_assert(lttv_iattribute_find_by_path(attributes_global
,
133 "viewers/toolbar", LTTV_POINTER
, &value
));
134 toolbar
= (LttvToolbars
*)*(value
.v_pointer
);
136 main_window_remove_toolbar_item(view_constructor
);
138 lttv_toolbars_remove(toolbar
, view_constructor
);
143 * Function to register a view constructor so that main window can generate
144 * a menu item for the viewer in order to generate a new instance easily.
145 * It will be called by init function of the module.
146 * @param menu_path path of the menu item.
147 * @param menu_text text of the menu item.
148 * @param view_constructor constructor of the viewer.
151 void menu_item_reg(char *menu_path
, char *menu_text
, lttv_constructor view_constructor
)
153 LttvIAttribute
*attributes_global
= LTTV_IATTRIBUTE(lttv_global_attributes());
155 LttvAttributeValue value
;
157 g_assert(lttv_iattribute_find_by_path(attributes_global
,
158 "viewers/menu", LTTV_POINTER
, &value
));
159 menu
= (LttvMenus
*)*(value
.v_pointer
);
162 menu
= lttv_menus_new();
163 *(value
.v_pointer
) = menu
;
165 lttv_menus_add(menu
, view_constructor
, menu_path
, menu_text
);
169 * Function to unregister the viewer's constructor, release the space
170 * occupied by menu_path, menu_text and constructor of the viewer.
171 * It will be called when a module is unloaded.
172 * @param view_constructor constructor of the viewer which is used as
173 * a reference to find out where the menu_path and menu_text are.
176 void menu_item_unreg(lttv_constructor view_constructor
)
178 LttvIAttribute
*attributes_global
= LTTV_IATTRIBUTE(lttv_global_attributes());
180 LttvAttributeValue value
;
182 g_assert(lttv_iattribute_find_by_path(attributes_global
,
183 "viewers/menu", LTTV_POINTER
, &value
));
184 menu
= (LttvMenus
*)*(value
.v_pointer
);
186 main_window_remove_menu_item(view_constructor
);
188 lttv_menus_remove(menu
, view_constructor
);
193 * Update the status bar whenever something changed in the viewer.
194 * @param main_win the main window the viewer belongs to.
195 * @param info the message which will be shown in the status bar.
198 void update_status(MainWindow
*main_win
, char *info
)
204 * Function to get the current time interval shown on the current tab.
205 * It will be called by a viewer's hook function to update the
206 * shown time interval of the viewer and also be called by the constructor
208 * @param main_win the main window the viewer belongs to.
209 * @param time_interval a pointer where time interval will be stored.
212 void get_time_window(MainWindow
*main_win
, TimeWindow
*time_window
)
214 //time_window->start_time = main_win->current_tab->time_window.start_time;
215 //time_window->time_width = main_win->current_tab->time_window.time_width;
216 *time_window
= main_win
->current_tab
->time_window
;
220 * Function to get the current time interval of the current traceset.
221 * It will be called by a viewer's hook function to update the
222 * time interval of the viewer and also be called by the constructor
224 * @param main_win the main window the viewer belongs to.
225 * @param time_interval a pointer where time interval will be stored.
228 void get_traceset_time_span(MainWindow
*main_win
, TimeInterval
*time_interval
)
230 //time_window->start_time = main_win->current_tab->time_window.start_time;
231 //time_window->time_width = main_win->current_tab->time_window.time_width;
232 *time_interval
= *(LTTV_TRACESET_CONTEXT(main_win
->current_tab
->traceset_info
->
233 traceset_context
)->Time_Span
);
239 * Function to set the time interval of the current tab.
240 * It will be called by a viewer's signal handle associated with
241 * the move_slider signal
242 * @param main_win the main window the viewer belongs to.
243 * @param time_interval a pointer where time interval is stored.
246 void set_time_window(MainWindow
*main_win
, TimeWindow
*time_window
)
248 LttvAttributeValue value
;
250 main_win
->current_tab
->time_window
= *time_window
;
251 gtk_multi_vpaned_set_scroll_value(main_win
->current_tab
->multi_vpaned
,
252 ltt_time_to_double(time_window
->start_time
)
253 * NANOSECONDS_PER_SECOND
);
254 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
255 "hooks/updatetimewindow", LTTV_POINTER
, &value
));
256 tmp
= (LttvHooks
*)*(value
.v_pointer
);
257 if(tmp
== NULL
) return;
258 lttv_hooks_call(tmp
, time_window
);
263 * Function to get the current time/event of the current tab.
264 * It will be called by a viewer's hook function to update the
265 * current time/event of the viewer.
266 * @param main_win the main window the viewer belongs to.
267 * @param time a pointer where time will be stored.
270 void get_current_time(MainWindow
*main_win
, LttTime
*time
)
272 time
= &main_win
->current_tab
->current_time
;
277 * Function to set the current time/event of the current tab.
278 * It will be called by a viewer's signal handle associated with
279 * the button-release-event signal
280 * @param main_win the main window the viewer belongs to.
281 * @param time a pointer where time is stored.
284 void set_current_time(MainWindow
*main_win
, LttTime
*time
)
286 LttvAttributeValue value
;
288 main_win
->current_tab
->current_time
= *time
;
289 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
290 "hooks/updatecurrenttime", LTTV_POINTER
, &value
));
291 tmp
= (LttvHooks
*)*(value
.v_pointer
);
293 if(tmp
== NULL
)return;
294 lttv_hooks_call(tmp
, time
);
299 * Function to get the traceset from the current tab.
300 * It will be called by the constructor of the viewer and also be
301 * called by a hook funtion of the viewer to update its traceset.
302 * @param main_win the main window the viewer belongs to.
303 * @param traceset a pointer to a traceset.
306 void get_traceset(MainWindow *main_win, Traceset *traceset)
312 * Function to get the filter of the current tab.
313 * It will be called by the constructor of the viewer and also be
314 * called by a hook funtion of the viewer to update its filter.
315 * @param main_win, the main window the viewer belongs to.
316 * @param filter, a pointer to a filter.
319 void get_filter(MainWindow *main_win, Filter *filter)
325 * Function to register a hook function for a viewer to set/update its
327 * It will be called by the constructor of the viewer.
328 * @param hook hook function of the viewer.
329 * @param hook_data hook data associated with the hook function.
330 * @param main_win the main window the viewer belongs to.
333 void reg_update_time_window(LttvHook hook
, gpointer hook_data
,
334 MainWindow
* main_win
)
336 LttvAttributeValue value
;
338 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
339 "hooks/updatetimewindow", LTTV_POINTER
, &value
));
340 tmp
= (LttvHooks
*)*(value
.v_pointer
);
342 tmp
= lttv_hooks_new();
343 *(value
.v_pointer
) = tmp
;
345 lttv_hooks_add(tmp
, hook
,hook_data
);
350 * Function to unregister a viewer's hook function which is used to
351 * set/update the time interval of the viewer.
352 * It will be called by the destructor of the viewer.
353 * @param hook hook function of the viewer.
354 * @param hook_data hook data associated with the hook function.
355 * @param main_win the main window the viewer belongs to.
358 void unreg_update_time_window(LttvHook hook
, gpointer hook_data
,
359 MainWindow
* main_win
)
361 LttvAttributeValue value
;
363 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
364 "hooks/updatetimewindow", LTTV_POINTER
, &value
));
365 tmp
= (LttvHooks
*)*(value
.v_pointer
);
366 if(tmp
== NULL
) return;
367 lttv_hooks_remove_data(tmp
, hook
, hook_data
);
372 * Function to register a hook function for a viewer to set/update its
374 * It will be called by the constructor of the viewer.
375 * @param hook hook function of the viewer.
376 * @param hook_data hook data associated with the hook function.
377 * @param main_win the main window the viewer belongs to.
380 void reg_update_traceset(LttvHook hook
, gpointer hook_data
,
381 MainWindow
* main_win
)
383 LttvAttributeValue value
;
385 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
386 "hooks/updatetraceset", LTTV_POINTER
, &value
));
387 tmp
= (LttvHooks
*)*(value
.v_pointer
);
389 tmp
= lttv_hooks_new();
390 *(value
.v_pointer
) = tmp
;
392 lttv_hooks_add(tmp
, hook
, hook_data
);
397 * Function to unregister a viewer's hook function which is used to
398 * set/update the traceset of the viewer.
399 * It will be called by the destructor of the viewer.
400 * @param hook hook function of the viewer.
401 * @param hook_data hook data associated with the hook function.
402 * @param main_win the main window the viewer belongs to.
405 void unreg_update_traceset(LttvHook hook
, gpointer hook_data
,
406 MainWindow
* main_win
)
408 LttvAttributeValue value
;
410 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
411 "hooks/updatetraceset", LTTV_POINTER
, &value
));
412 tmp
= (LttvHooks
*)*(value
.v_pointer
);
413 if(tmp
== NULL
) return;
414 lttv_hooks_remove_data(tmp
, hook
, hook_data
);
419 * Function to redraw each viewer belonging to the current tab
420 * @param main_win the main window the viewer belongs to.
423 void update_traceset(MainWindow
* main_win
)
425 LttvAttributeValue value
;
427 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
428 "hooks/updatetraceset", LTTV_POINTER
, &value
));
429 tmp
= (LttvHooks
*)*(value
.v_pointer
);
430 if(tmp
== NULL
) return;
431 lttv_hooks_call(tmp
, NULL
);
436 * Function to register a hook function for a viewer to set/update its
438 * It will be called by the constructor of the viewer.
439 * @param hook hook function of the viewer.
440 * @param hook_data hook data associated with the hook function.
441 * @param main_win the main window the viewer belongs to.
444 void reg_update_filter(LttvHook hook
, gpointer hook_data
,
445 MainWindow
*main_win
)
447 LttvAttributeValue value
;
449 g_assert(lttv_iattribute_find_by_path(main_win
->attributes
,
450 "hooks/updatefilter", LTTV_POINTER
, &value
));
451 tmp
= (LttvHooks
*)*(value
.v_pointer
);
453 tmp
= lttv_hooks_new();
454 *(value
.v_pointer
) = tmp
;
456 lttv_hooks_add(tmp
, hook
, hook_data
);
461 * Function to unregister a viewer's hook function which is used to
462 * set/update the filter of the viewer.
463 * It will be called by the destructor of the viewer.
464 * @param hook hook function of the viewer.
465 * @param hook_data hook data associated with the hook function.
466 * @param main_win the main window the viewer belongs to.
469 void unreg_update_filter(LttvHook hook
, gpointer hook_data
,
470 MainWindow
* main_win
)
472 LttvAttributeValue value
;
474 g_assert(lttv_iattribute_find_by_path(main_win
->attributes
,
475 "hooks/updatefilter", LTTV_POINTER
, &value
));
476 tmp
= (LttvHooks
*)*(value
.v_pointer
);
477 if(tmp
== NULL
) return;
478 lttv_hooks_remove_data(tmp
, hook
, hook_data
);
483 * Function to register a hook function for a viewer to set/update its
485 * It will be called by the constructor of the viewer.
486 * @param hook hook function of the viewer.
487 * @param hook_data hook data associated with the hook function.
488 * @param main_win the main window the viewer belongs to.
491 void reg_update_current_time(LttvHook hook
, gpointer hook_data
,
492 MainWindow
*main_win
)
494 LttvAttributeValue value
;
496 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
497 "hooks/updatecurrenttime", LTTV_POINTER
, &value
));
498 tmp
= (LttvHooks
*)*(value
.v_pointer
);
500 tmp
= lttv_hooks_new();
501 *(value
.v_pointer
) = tmp
;
503 lttv_hooks_add(tmp
, hook
, hook_data
);
508 * Function to unregister a viewer's hook function which is used to
509 * set/update the current time of the viewer.
510 * It will be called by the destructor of the viewer.
511 * @param hook hook function of the viewer.
512 * @param hook_data hook data associated with the hook function.
513 * @param main_win the main window the viewer belongs to.
516 void unreg_update_current_time(LttvHook hook
, gpointer hook_data
,
517 MainWindow
* main_win
)
519 LttvAttributeValue value
;
521 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
522 "hooks/updatecurrenttime", LTTV_POINTER
, &value
));
523 tmp
= (LttvHooks
*)*(value
.v_pointer
);
524 if(tmp
== NULL
) return;
525 lttv_hooks_remove_data(tmp
, hook
, hook_data
);
530 * Function to register a hook function for a viewer to show
531 *the content of the viewer.
532 * It will be called by the constructor of the viewer.
533 * @param hook hook function of the viewer.
534 * @param hook_data hook data associated with the hook function.
535 * @param main_win the main window the viewer belongs to.
538 void reg_show_viewer(LttvHook hook
, gpointer hook_data
,
539 MainWindow
*main_win
)
541 LttvAttributeValue value
;
543 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
544 "hooks/showviewer", LTTV_POINTER
, &value
));
545 tmp
= (LttvHooks
*)*(value
.v_pointer
);
547 tmp
= lttv_hooks_new();
548 *(value
.v_pointer
) = tmp
;
550 lttv_hooks_add(tmp
, hook
, hook_data
);
555 * Function to unregister a viewer's hook function which is used to
556 * show the content of the viewer..
557 * It will be called by the destructor of the viewer.
558 * @param hook hook function of the viewer.
559 * @param hook_data hook data associated with the hook function.
560 * @param main_win the main window the viewer belongs to.
563 void unreg_show_viewer(LttvHook hook
, gpointer hook_data
,
564 MainWindow
* main_win
)
566 LttvAttributeValue value
;
568 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
569 "hooks/showviewer", LTTV_POINTER
, &value
));
570 tmp
= (LttvHooks
*)*(value
.v_pointer
);
571 if(tmp
== NULL
) return;
572 lttv_hooks_remove_data(tmp
, hook
, hook_data
);
577 * Function to show each viewer in the current tab.
578 * It will be called by main window after it called process_traceset
579 * @param main_win the main window the viewer belongs to.
582 void show_viewer(MainWindow
*main_win
)
584 LttvAttributeValue value
;
586 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
587 "hooks/showviewer", LTTV_POINTER
, &value
));
588 tmp
= (LttvHooks
*)*(value
.v_pointer
);
589 if(tmp
== NULL
) return;
590 lttv_hooks_call(tmp
, NULL
);
595 * Function to set the focused pane (viewer).
596 * It will be called by a viewer's signal handle associated with
597 * the grab_focus signal
598 * @param main_win the main window the viewer belongs to.
599 * @param paned a pointer to a pane where the viewer is contained.
602 void set_focused_pane(MainWindow
*main_win
, gpointer paned
)
604 gtk_multi_vpaned_set_focus((GtkWidget
*)main_win
->current_tab
->multi_vpaned
,paned
);
609 * Function to register a hook function for a viewer to set/update the
610 * dividor of the hpane.
611 * It will be called by the constructor of the viewer.
612 * @param hook hook function of the viewer.
613 * @param hook_data hook data associated with the hook function.
614 * @param main_win the main window the viewer belongs to.
617 void reg_update_dividor(LttvHook hook
, gpointer hook_data
,
618 MainWindow
*main_win
)
620 LttvAttributeValue value
;
622 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
623 "hooks/hpanedividor", LTTV_POINTER
, &value
));
624 tmp
= (LttvHooks
*)*(value
.v_pointer
);
626 tmp
= lttv_hooks_new();
627 *(value
.v_pointer
) = tmp
;
629 lttv_hooks_add(tmp
, hook
, hook_data
);
634 * Function to unregister a viewer's hook function which is used to
635 * set/update hpane's dividor of the viewer.
636 * It will be called by the destructor of the viewer.
637 * @param hook hook function of the viewer.
638 * @param hook_data hook data associated with the hook function.
639 * @param main_win the main window the viewer belongs to.
642 void unreg_update_dividor(LttvHook hook
, gpointer hook_data
,
643 MainWindow
*main_win
)
645 LttvAttributeValue value
;
647 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
648 "hooks/hpanedividor", LTTV_POINTER
, &value
));
649 tmp
= (LttvHooks
*)*(value
.v_pointer
);
650 if(tmp
== NULL
) return;
651 lttv_hooks_remove_data(tmp
, hook
, hook_data
);
656 * Function to set the position of the hpane's dividor (viewer).
657 * It will be called by a viewer's signal handle associated with
658 * the motion_notify_event event/signal
659 * @param main_win the main window the viewer belongs to.
660 * @param position position of the hpane's dividor.
663 void set_hpane_dividor(MainWindow
*main_win
, gint position
)
665 LttvAttributeValue value
;
667 g_assert(lttv_iattribute_find_by_path(main_win
->current_tab
->attributes
,
668 "hooks/hpanedividor", LTTV_POINTER
, &value
));
669 tmp
= (LttvHooks
*)*(value
.v_pointer
);
670 if(tmp
== NULL
) return;
671 lttv_hooks_call(tmp
, &position
);
676 * Function to process traceset. It will call lttv_process_trace,
677 * each view will call this api to get events.
678 * @param main_win the main window the viewer belongs to.
679 * @param start the start time of the first event to be processed.
680 * @param end the end time of the last event to be processed.
683 void process_traceset_api(MainWindow
*main_win
, LttTime start
,
684 LttTime end
, unsigned maxNumEvents
)
686 lttv_process_traceset_seek_time(
687 LTTV_TRACESET_CONTEXT(main_win
->current_tab
->traceset_info
->
690 lttv_process_traceset(
691 LTTV_TRACESET_CONTEXT(main_win
->current_tab
->traceset_info
->
698 * Function to add hooks into the context of a traceset,
699 * before reading events from traceset, viewer will call this api to
701 * @param main_win the main window the viewer belongs to.
702 * @param LttvHooks hooks to be registered.
705 void context_add_hooks_api(MainWindow
*main_win
,
706 LttvHooks
*before_traceset
,
707 LttvHooks
*after_traceset
,
708 LttvHooks
*check_trace
,
709 LttvHooks
*before_trace
,
710 LttvHooks
*after_trace
,
711 LttvHooks
*check_tracefile
,
712 LttvHooks
*before_tracefile
,
713 LttvHooks
*after_tracefile
,
714 LttvHooks
*check_event
,
715 LttvHooks
*before_event
,
716 LttvHooks
*after_event
)
718 LttvTracesetContext
* tsc
=
719 LTTV_TRACESET_CONTEXT(main_win
->current_tab
->traceset_info
->
721 lttv_traceset_context_add_hooks(tsc
,before_traceset
,after_traceset
,
722 check_trace
,before_trace
,after_trace
,
723 check_tracefile
,before_tracefile
,after_tracefile
,
724 check_event
,before_event
, after_event
);
729 * Function to remove hooks from the context of a traceset,
730 * before reading events from traceset, viewer will call this api to
732 * @param main_win the main window the viewer belongs to.
733 * @param LttvHooks hooks to be registered.
736 void context_remove_hooks_api(MainWindow
*main_win
,
737 LttvHooks
*before_traceset
,
738 LttvHooks
*after_traceset
,
739 LttvHooks
*check_trace
,
740 LttvHooks
*before_trace
,
741 LttvHooks
*after_trace
,
742 LttvHooks
*check_tracefile
,
743 LttvHooks
*before_tracefile
,
744 LttvHooks
*after_tracefile
,
745 LttvHooks
*check_event
,
746 LttvHooks
*before_event
,
747 LttvHooks
*after_event
)
749 LttvTracesetContext
* tsc
=
750 LTTV_TRACESET_CONTEXT(main_win
->current_tab
->traceset_info
->traceset_context
);
751 lttv_traceset_context_remove_hooks(tsc
,before_traceset
,after_traceset
,
752 check_trace
,before_trace
,after_trace
,
753 check_tracefile
,before_tracefile
,after_tracefile
,
754 check_event
,before_event
, after_event
);
759 * Function to add/remove event hooks for state
760 * @param main_win the main window the viewer belongs to.
763 void state_add_event_hooks_api(MainWindow
*main_win
)
765 lttv_state_add_event_hooks(
766 (LttvTracesetState
*)main_win
->current_tab
->traceset_info
->traceset_context
);
769 void state_remove_event_hooks_api(MainWindow
*main_win
)
771 lttv_state_remove_event_hooks(
772 (LttvTracesetState
*)main_win
->current_tab
->traceset_info
->traceset_context
);
777 * Function to add/remove event hooks for stats
778 * @param main_win the main window the viewer belongs to.
781 void stats_add_event_hooks_api(MainWindow
*main_win
)
783 lttv_stats_add_event_hooks(
784 (LttvTracesetStats
*)main_win
->current_tab
->traceset_info
->traceset_context
);
787 void stats_remove_event_hooks_api(MainWindow
*main_win
)
789 lttv_stats_remove_event_hooks(
790 (LttvTracesetStats
*)main_win
->current_tab
->traceset_info
->traceset_context
);
794 * Function to get the stats of the traceset
795 * @param main_win the main window the viewer belongs to.
798 LttvTracesetStats
* get_traceset_stats_api(MainWindow
*main_win
)
800 return main_win
->current_tab
->traceset_info
->traceset_context
;
804 LttvTracesetContext
* get_traceset_context(MainWindow
*main_win
)
806 return (LttvTracesetContext
*)main_win
->current_tab
->traceset_info
->traceset_context
;