Commit | Line | Data |
---|---|---|
ce0214a6 | 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 | |
b9ce0bad YB |
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
16 | * MA 02110-1301, USA. | |
ce0214a6 | 17 | */ |
18 | ||
19 | ||
20 | /* eventhooks.h defines the hooks that are given to processTrace as parameter. | |
501d5405 | 21 | * These hooks call the drawing API to draw the information on the screen, |
831a876d | 22 | * using information from Context, but mostly state (running, waiting...). |
23 | */ | |
24 | ||
f0d936c0 | 25 | |
26 | #ifndef _EVENT_HOOKS_H | |
27 | #define _EVENT_HOOKS_H | |
28 | ||
1ab818de | 29 | #include <gtk/gtk.h> |
13f86ce2 | 30 | #include <lttvwindow/mainwindow.h> |
d66666fe | 31 | |
32 | #include "processlist.h" | |
33 | #include "drawing.h" | |
34 | #include "cfv.h" | |
f66eba62 | 35 | |
36 | ||
37 | /* Structure used to store and use information relative to one events refresh | |
38 | * request. Typically filled in by the expose event callback, then passed to the | |
39 | * library call, then used by the drawing hooks. Then, once all the events are | |
40 | * sent, it is freed by the hook called after the reading. | |
41 | */ | |
ca0f8a8e | 42 | //typedef struct _EventRequest |
43 | //{ | |
44 | // ControlFlowData *control_flow_data; | |
45 | // LttTime time_begin, time_end; | |
46 | // gint x_begin, x_end; | |
a56a1ba4 | 47 | /* Fill the Events_Context during the initial expose, before calling for |
48 | * events. | |
49 | */ | |
50 | //GArray Events_Context; //FIXME | |
ca0f8a8e | 51 | //} EventRequest ; |
f66eba62 | 52 | |
53 | ||
54 | ||
55 | ||
5f16133f | 56 | |
501d5405 | 57 | void send_test_data(ProcessList *process_list, Drawing_t *drawing); |
1ab818de | 58 | |
e433e6d6 | 59 | GtkWidget *h_guicontrolflow(LttvPlugin *plugin); |
f0d936c0 | 60 | |
e433e6d6 | 61 | GtkWidget *h_legend(LttvPlugin *plugin); |
0de51231 | 62 | |
4c69e0cc | 63 | int event_selected_hook(void *hook_data, void *call_data); |
f0d936c0 | 64 | |
f0d936c0 | 65 | /* |
66 | * The draw event hook is called by the reading API to have a | |
67 | * particular event drawn on the screen. | |
68 | * @param hook_data ControlFlowData structure of the viewer. | |
b9a010a2 | 69 | * @param call_data Event context with state. |
f0d936c0 | 70 | * |
71 | * This function basically draw lines and icons. Two types of lines are drawn : | |
72 | * one small (3 pixels?) representing the state of the process and the second | |
73 | * type is thicker (10 pixels?) representing on which CPU a process is running | |
74 | * (and this only in running state). | |
75 | * | |
76 | * Extremums of the lines : | |
77 | * x_min : time of the last event context for this process kept in memory. | |
78 | * x_max : time of the current event. | |
79 | * y : middle of the process in the process list. The process is found in the | |
80 | * list, therefore is it's position in pixels. | |
81 | * | |
82 | * The choice of lines'color is defined by the context of the last event for this | |
83 | * process. | |
84 | */ | |
e92eabaf | 85 | int before_schedchange_hook(void *hook_data, void *call_data); |
86 | int after_schedchange_hook(void *hook_data, void *call_data); | |
068572ab | 87 | int before_trywakeup_hook(void *hook_data, void *call_data); |
23093869 | 88 | int before_execmode_hook(void *hook_data, void *call_data); |
89 | int after_execmode_hook(void *hook_data, void *call_data); | |
2c82c4dc | 90 | |
91 | ||
92 | int before_process_exit_hook(void *hook_data, void *call_data); | |
93 | int before_process_release_hook(void *hook_data, void *call_data); | |
94 | int after_process_exit_hook(void *hook_data, void *call_data); | |
95 | int after_process_fork_hook(void *hook_data, void *call_data); | |
f4b88a7d | 96 | int after_fs_exec_hook(void *hook_data, void *call_data); |
b3fd4c02 | 97 | int after_event_enum_process_hook(void *hook_data, void *call_data); |
2c82c4dc | 98 | |
99 | #if 0 | |
dbd243b1 | 100 | int before_process_hook(void *hook_data, void *call_data); |
101 | int after_process_hook(void *hook_data, void *call_data); | |
2c82c4dc | 102 | #endif //0 |
f0d936c0 | 103 | |
8b90e648 | 104 | void draw_closure(gpointer key, gpointer value, gpointer user_data); |
105 | ||
b9a010a2 | 106 | int before_chunk(void *hook_data, void *call_data); |
107 | int after_chunk(void *hook_data, void *call_data); | |
108 | int before_request(void *hook_data, void *call_data); | |
109 | int after_request(void *hook_data, void *call_data); | |
b70ceef8 | 110 | int before_statedump_end(void *hook_data, void *call_data); |
b9a010a2 | 111 | |
8b90e648 | 112 | |
113 | ||
1b238973 | 114 | gint update_time_window_hook(void *hook_data, void *call_data); |
115 | gint update_current_time_hook(void *hook_data, void *call_data); | |
6395d57c | 116 | gint traceset_notify(void *hook_data, void *call_data); |
ca0f8a8e | 117 | gint redraw_notify(void *hook_data, void *call_data); |
118 | gint continue_notify(void *hook_data, void *call_data); | |
f7afe191 | 119 | |
0de51231 | 120 | void legend_destructor(GtkWindow *legend); |
121 | ||
f0d936c0 | 122 | #endif // _EVENT_HOOKS_H |