1 /* This file is part of the Linux Trace Toolkit Graphic User Interface
2 * Copyright (C) 2003-2004 Mathieu Desnoyers
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 /* This file is the API used to launch any background computation on a trace */
21 #ifndef LTTVWINDOWTRACES_H
22 #define LTTVWINDOWTRACES_H
27 typedef GQuark LttvTraceInfo
;
29 extern LttvTraceInfo LTTV_TRACES
,
32 LTTV_REQUESTS_CURRENT
,
35 LTTV_COMPUTATION_TRACESET
,
36 LTTV_COMPUTATION_TRACESET_CONTEXT
,
37 LTTV_BEFORE_CHUNK_TRACESET
,
38 LTTV_BEFORE_CHUNK_TRACE
,
39 LTTV_BEFORE_CHUNK_TRACEFILE
,
40 LTTV_AFTER_CHUNK_TRACESET
,
41 LTTV_AFTER_CHUNK_TRACE
,
42 LTTV_AFTER_CHUNK_TRACEFILE
,
46 LTTV_EVENT_HOOK_BY_ID
,
52 /* Get a trace by its path name.
54 * @param path path of the trace on the virtual file system.
55 * @return Pointer to trace if found
56 * NULL is returned if the trace is not present
59 LttvTrace
*lttvwindowtraces_get_trace_by_name(gchar
*path
);
61 /* Get a trace by its number identifier */
63 LttvTrace
*lttvwindowtraces_get_trace(guint num
);
65 /* Total number of traces */
67 guint
lttvwindowtraces_get_number();
69 /* Add a trace to the global attributes */
71 void lttvwindowtraces_add_trace(LttvTrace
*trace
);
73 /* Remove a trace from the global attributes */
75 void lttvwindowtraces_remove_trace(LttvTrace
*trace
);
79 * Function to request data from a specific trace
81 * The memory allocated for the request will be managed by the API.
83 * @param trace the trace to compute
84 * @param module_name the name of the module which registered global computation
88 void lttvwindowtraces_background_request_queue
89 (LttvTrace
*trace
, gchar
*module_name
);
92 * Remove a background request from a trace.
94 * This should ONLY be used by the modules which registered the global hooks
95 * (module_name). If this is called by the viewers, it may lead to incomplete
96 * and incoherent background processing information.
98 * Even if the module which deals with the hooks removes the background
99 * requests, it may cause a problem if the module gets loaded again in the
100 * session : the data will be partially calculated. The calculation function
101 * must deal with this case correctly.
103 * @param trace the trace to compute
104 * @param module_name the name of the module which registered global computation
108 void lttvwindowtraces_background_request_remove
109 (LttvTrace
*trace
, gchar
*module_name
);
112 * Register a callback to be called when requested data is passed in the next
113 * queued background processing.
115 * @param owner owner of the background notification
116 * @param trace the trace computed
117 * @param notify_time time when notification hooks must be called
118 * @param notify_position position when notification hooks must be called
119 * @param notify Hook to call when the notify position is passed
122 void lttvwindowtraces_background_notify_queue
126 const LttvTracesetContextPosition
*notify_position
,
127 const LttvHooks
*notify
);
130 * Register a callback to be called when requested data is passed in the current
131 * background processing.
133 * @param owner owner of the background notification
134 * @param trace the trace computed
135 * @param notify_time time when notification hooks must be called
136 * @param notify_position position when notification hooks must be called
137 * @param notify Hook to call when the notify position is passed
140 void lttvwindowtraces_background_notify_current
144 const LttvTracesetContextPosition
*notify_position
,
145 const LttvHooks
*notify
);
148 * Removes all the notifications requests from a specific viewer.
150 * @param owner owner of the background notification
153 void lttvwindowtraces_background_notify_remove(gpointer owner
);
156 #endif //LTTVWINDOWTRACES_H