03d7fdf3 |
1 | /* This file is part of the Linux Trace Toolkit viewer |
2 | * Copyright (C) 2003-2004 Mathieu Desnoyers |
3 | * |
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; |
7 | * |
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. |
12 | * |
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, |
16 | * MA 02111-1307, USA. |
17 | */ |
18 | |
19 | |
20 | /* eventhooks.h defines the hooks that are given to processTrace as parameter. |
21 | * These hooks call the drawing API to draw the information on the screen, |
22 | * using information from Context, but mostly state (running, waiting...). |
23 | */ |
24 | |
25 | |
26 | #ifndef _XENOLTT_EVENT_HOOKS_H |
27 | #define _XENOLTT_EVENT_HOOKS_H |
28 | |
29 | #include <gtk/gtk.h> |
30 | #include <lttvwindow/mainwindow.h> |
31 | #include <ltt/time.h> |
32 | |
33 | #include "xenoltt_threadlist.h" |
34 | #include "xenoltt_drawing.h" |
35 | #include "xfv.h" |
36 | |
37 | |
38 | /* Structure used to store and use information relative to one events refresh |
39 | * request. Typically filled in by the expose event callback, then passed to the |
40 | * library call, then used by the drawing hooks. Then, once all the events are |
41 | * sent, it is freed by the hook called after the reading. |
42 | */ |
43 | //typedef struct _EventRequest |
44 | //{ |
45 | // ControlFlowData *control_flow_data; |
46 | // LttTime time_begin, time_end; |
47 | // gint x_begin, x_end; |
48 | /* Fill the Events_Context during the initial expose, before calling for |
49 | * events. |
50 | */ |
51 | //GArray Events_Context; //FIXME |
52 | //} EventRequest ; |
53 | |
54 | |
55 | |
56 | |
57 | |
58 | void send_test_data(ThreadList *thread_list, XenoLtt_Drawing_t *drawing); |
59 | |
60 | GtkWidget *h_guixenoltt(LttvPlugin *plugin); |
61 | |
62 | GtkWidget *h_xenolttlegend(LttvPlugin *plugin); |
63 | GtkWidget *h_xenolttsimulation(LttvPlugin *plugin); |
64 | |
65 | int event_selected_hook(void *hook_data, void *call_data); |
66 | |
67 | /* |
68 | * The draw event hook is called by the reading API to have a |
69 | * particular event drawn on the screen. |
70 | * @param hook_data ControlFlowData structure of the viewer. |
71 | * @param call_data Event context with state. |
72 | * |
73 | * This function basically draw lines and icons. Two types of lines are drawn : |
74 | * one small (3 pixels?) representing the state of the process and the second |
75 | * type is thicker (10 pixels?) representing on which CPU a process is running |
76 | * (and this only in running state). |
77 | * |
78 | * Extremums of the lines : |
79 | * x_min : time of the last event context for this process kept in memory. |
80 | * x_max : time of the current event. |
81 | * y : middle of the process in the process list. The process is found in the |
82 | * list, therefore is it's position in pixels. |
83 | * |
84 | * The choice of lines'color is defined by the context of the last event for this |
85 | * process. |
86 | */ |
87 | /* |
88 | int before_schedchange_hook(void *hook_data, void *call_data); |
89 | int after_schedchange_hook(void *hook_data, void *call_data); |
90 | int before_execmode_hook(void *hook_data, void *call_data); |
91 | int after_execmode_hook(void *hook_data, void *call_data); |
92 | */ |
93 | /* |
94 | int before_process_exit_hook(void *hook_data, void *call_data); |
95 | int before_process_release_hook(void *hook_data, void *call_data); |
96 | int after_process_exit_hook(void *hook_data, void *call_data); |
97 | int after_process_fork_hook(void *hook_data, void *call_data); |
98 | int after_fs_exec_hook(void *hook_data, void *call_data); |
99 | int after_user_generic_thread_brand_hook(void *hook_data, void *call_data); |
100 | int after_event_enum_process_hook(void *hook_data, void *call_data); |
101 | |
102 | #if 0 |
103 | int before_process_hook(void *hook_data, void *call_data); |
104 | int after_process_hook(void *hook_data, void *call_data); |
105 | #endif //0 |
106 | */ |
107 | void draw_closure(gpointer key, gpointer value, gpointer user_data); |
108 | |
109 | int xenoltt_before_chunk(void *hook_data, void *call_data); |
110 | int xenoltt_after_chunk(void *hook_data, void *call_data); |
111 | int xenoltt_before_request(void *hook_data, void *call_data); |
112 | int xenoltt_after_request(void *hook_data, void *call_data); |
113 | |
114 | |
115 | |
116 | gint update_time_window_hook(void *hook_data, void *call_data); |
117 | gint update_current_time_hook(void *hook_data, void *call_data); |
118 | gint traceset_notify(void *hook_data, void *call_data); |
119 | gint redraw_notify(void *hook_data, void *call_data); |
120 | gint continue_notify(void *hook_data, void *call_data); |
121 | |
122 | void xenolttlegend_destructor(GtkWindow *legend); |
123 | void xenolttsimulation_destructor(GtkWindow *simulation); |
124 | |
125 | |
126 | /**************************************************** |
127 | * JOV - XenoLTT - 2006-09-26 |
128 | * Xenomai task creation event |
129 | ****************************************************/ |
130 | int xenoltt_before_thread_hook(void *hook_data, void *call_data); |
131 | int xenoltt_after_thread_hook(void *hook_data, void *call_data); |
132 | int xenoltt_before_thread_switch_hook(void *hook_data, void *call_data); |
133 | |
134 | int xenoltt_thread_init(void *hook_data, void *call_data); |
135 | int xenoltt_thread_set_period(void *hook_data, void *call_data); |
136 | |
137 | int xenoltt_draw_icons(void *hook_data, void *call_data); |
138 | |
139 | |
140 | #endif // _EVENT_HOOKS_H |