a1a2b649 |
1 | /* This file is part of the Linux Trace Toolkit Graphic User Interface |
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 | /* This file is the API used to launch any background computation on a trace */ |
20 | |
21 | #ifndef LTTVWINDOWTRACES_H |
22 | #define LTTVWINDOWTRACES_H |
23 | |
24 | #include <ltt/time.h> |
25 | #include <glib.h> |
26 | |
27 | typedef GQuark LttvTraceInfo; |
28 | |
29 | extern LttvTraceInfo LTTV_TRACES, |
30 | LTTV_COMPUTATION, |
31 | LTTV_REQUESTS_QUEUE, |
32 | LTTV_REQUESTS_CURRENT, |
33 | LTTV_NOTIFY_QUEUE, |
34 | LTTV_NOTIFY_CURRENT; |
35 | |
36 | /* Get a trace by its path name. |
37 | * |
38 | * @param path path of the trace on the virtual file system. |
39 | * @return Pointer to trace if found |
40 | * NULL is returned if the trace is not present |
41 | */ |
42 | |
43 | LttvTrace *lttvwindowtraces_get_trace_by_name(gchar *path); |
44 | |
45 | /* Get a trace by its number identifier */ |
46 | |
47 | LttvTrace *lttvwindowtraces_get_trace(guint num); |
48 | |
49 | /* Total number of traces */ |
50 | |
51 | guint lttvwindowtraces_get_number(); |
52 | |
53 | /* Add a trace to the global attributes */ |
54 | |
55 | void lttvwindowtraces_add_trace(LttvTrace *trace); |
56 | |
57 | /* Remove a trace from the global attributes */ |
58 | |
59 | void lttvwindowtraces_remove_trace(LttvTrace *trace); |
60 | |
61 | |
62 | /** |
63 | * Function to request data from a specific trace |
64 | * |
65 | * The memory allocated for the request will be managed by the API. |
66 | * |
67 | * @param trace the trace to compute |
68 | * @param module_name the name of the module which registered global computation |
69 | * hooks. |
70 | */ |
71 | |
72 | void lttvwindowtraces_background_request_queue |
73 | (LttvTrace *trace, gchar *module_name); |
74 | |
75 | /** |
76 | * Remove a background request from a trace. |
77 | * |
78 | * This should ONLY be used by the modules which registered the global hooks |
79 | * (module_name). If this is called by the viewers, it may lead to incomplete |
80 | * and incoherent background processing information. |
81 | * |
82 | * Even if the module which deals with the hooks removes the background |
83 | * requests, it may cause a problem if the module gets loaded again in the |
84 | * session : the data will be partially calculated. The calculation function |
85 | * must deal with this case correctly. |
86 | * |
87 | * @param trace the trace to compute |
88 | * @param module_name the name of the module which registered global computation |
89 | * hooks. |
90 | */ |
91 | |
92 | void lttvwindowtraces_background_request_remove |
93 | (LttvTrace *trace, gchar *module_name); |
94 | |
95 | /** |
96 | * Register a callback to be called when requested data is passed in the next |
97 | * queued background processing. |
98 | * |
99 | * @param owner owner of the background notification |
100 | * @param trace the trace computed |
101 | * @param notify_time time when notification hooks must be called |
102 | * @param notify_position position when notification hooks must be called |
103 | * @param notify Hook to call when the notify position is passed |
104 | */ |
105 | |
106 | void lttvwindowtraces_background_notify_queue |
107 | (gpointer owner, |
108 | LttvTrace *trace, |
109 | LttTime notify_time, |
110 | const LttvTracesetContextPosition *notify_position, |
111 | const LttvHooks *notify); |
112 | |
113 | /** |
114 | * Register a callback to be called when requested data is passed in the current |
115 | * background processing. |
116 | * |
117 | * @param owner owner of the background notification |
118 | * @param trace the trace computed |
119 | * @param notify_time time when notification hooks must be called |
120 | * @param notify_position position when notification hooks must be called |
121 | * @param notify Hook to call when the notify position is passed |
122 | */ |
123 | |
124 | void lttvwindowtraces_background_notify_current |
125 | (gpointer owner, |
126 | LttvTrace *trace, |
127 | LttTime notify_time, |
128 | const LttvTracesetContextPosition *notify_position, |
129 | const LttvHooks *notify); |
130 | |
131 | /** |
132 | * Removes all the notifications requests from a specific viewer. |
133 | * |
134 | * @param owner owner of the background notification |
135 | */ |
136 | |
137 | void lttvwindowtraces_background_notify_remove(gpointer owner); |
138 | |
139 | |
140 | #endif //LTTVWINDOWTRACES_H |