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
,
36 /* Get a trace by its path name.
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
43 LttvTrace
*lttvwindowtraces_get_trace_by_name(gchar
*path
);
45 /* Get a trace by its number identifier */
47 LttvTrace
*lttvwindowtraces_get_trace(guint num
);
49 /* Total number of traces */
51 guint
lttvwindowtraces_get_number();
53 /* Add a trace to the global attributes */
55 void lttvwindowtraces_add_trace(LttvTrace
*trace
);
57 /* Remove a trace from the global attributes */
59 void lttvwindowtraces_remove_trace(LttvTrace
*trace
);
63 * Function to request data from a specific trace
65 * The memory allocated for the request will be managed by the API.
67 * @param trace the trace to compute
68 * @param module_name the name of the module which registered global computation
72 void lttvwindowtraces_background_request_queue
73 (LttvTrace
*trace
, gchar
*module_name
);
76 * Remove a background request from a trace.
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.
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.
87 * @param trace the trace to compute
88 * @param module_name the name of the module which registered global computation
92 void lttvwindowtraces_background_request_remove
93 (LttvTrace
*trace
, gchar
*module_name
);
96 * Register a callback to be called when requested data is passed in the next
97 * queued background processing.
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
106 void lttvwindowtraces_background_notify_queue
110 const LttvTracesetContextPosition
*notify_position
,
111 const LttvHooks
*notify
);
114 * Register a callback to be called when requested data is passed in the current
115 * background processing.
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
124 void lttvwindowtraces_background_notify_current
128 const LttvTracesetContextPosition
*notify_position
,
129 const LttvHooks
*notify
);
132 * Removes all the notifications requests from a specific viewer.
134 * @param owner owner of the background notification
137 void lttvwindowtraces_background_notify_remove(gpointer owner
);
140 #endif //LTTVWINDOWTRACES_H