Commit | Line | Data |
---|---|---|
eb1bab5b BH |
1 | /********************************************************************** |
2 | * Copyright (c) 2012 Ericsson | |
cfdb727a | 3 | * |
eb1bab5b BH |
4 | * All rights reserved. This program and the accompanying materials are |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
cfdb727a AM |
8 | * |
9 | * Contributors: | |
eb1bab5b BH |
10 | * Bernd Hufmann - Initial API and implementation |
11 | **********************************************************************/ | |
115b4a01 | 12 | package org.eclipse.linuxtools.internal.lttng2.ui.views.control.service; |
eb1bab5b BH |
13 | |
14 | import java.util.List; | |
15 | ||
16 | import org.eclipse.core.commands.ExecutionException; | |
17 | import org.eclipse.core.runtime.IProgressMonitor; | |
9315aeee BH |
18 | import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo; |
19 | import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo; | |
20 | import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo; | |
21 | import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo; | |
22 | import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType; | |
23 | import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel; | |
eb1bab5b BH |
24 | |
25 | ||
dbd4432d | 26 | /** |
eb1bab5b | 27 | * <p> |
cfdb727a | 28 | * Interface for LTTng trace control command service. |
eb1bab5b | 29 | * </p> |
cfdb727a | 30 | * |
dbd4432d | 31 | * @author Bernd Hufmann |
eb1bab5b BH |
32 | */ |
33 | public interface ILttngControlService { | |
276c17e7 BH |
34 | |
35 | /** | |
36 | * @return the version string. | |
37 | */ | |
38 | public String getVersion(); | |
39 | ||
d4514365 BH |
40 | /** |
41 | * Checks if given version is supported by this ILTTngControlService implementation. | |
42 | * | |
43 | * @param version The version to check | |
44 | * @return <code>true</code> if version is supported else <code>false</code> | |
45 | */ | |
46 | public boolean isVersionSupported(String version); | |
47 | ||
eb1bab5b BH |
48 | /** |
49 | * Retrieves the existing sessions names from the node. | |
cfdb727a AM |
50 | * |
51 | * @param monitor | |
52 | * - a progress monitor | |
eb1bab5b BH |
53 | * @return an array with session names. |
54 | * @throws ExecutionException | |
cfdb727a | 55 | * If the command fails |
eb1bab5b | 56 | */ |
cfdb727a AM |
57 | public String[] getSessionNames(IProgressMonitor monitor) |
58 | throws ExecutionException; | |
59 | ||
eb1bab5b BH |
60 | /** |
61 | * Retrieves the session information with the given name the node. | |
cfdb727a AM |
62 | * |
63 | * @param sessionName | |
64 | * - the session name | |
65 | * @param monitor | |
66 | * - a progress monitor | |
eb1bab5b BH |
67 | * @return session information |
68 | * @throws ExecutionException | |
cfdb727a AM |
69 | * If the command fails |
70 | */ | |
71 | public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) | |
72 | throws ExecutionException; | |
73 | ||
eb1bab5b BH |
74 | /** |
75 | * Retrieves the kernel provider information (i.e. the kernel events) | |
cfdb727a AM |
76 | * |
77 | * @param monitor | |
78 | * - a progress monitor | |
eb1bab5b BH |
79 | * @return the list of existing kernel events. |
80 | * @throws ExecutionException | |
cfdb727a | 81 | * If the command fails |
eb1bab5b | 82 | */ |
cfdb727a AM |
83 | public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) |
84 | throws ExecutionException; | |
85 | ||
eb1bab5b BH |
86 | /** |
87 | * Retrieves the UST provider information from the node. | |
cfdb727a | 88 | * |
eb1bab5b BH |
89 | * @return - the UST provider information. |
90 | * @throws ExecutionException | |
cfdb727a | 91 | * If the command fails |
eb1bab5b BH |
92 | */ |
93 | public List<IUstProviderInfo> getUstProvider() throws ExecutionException; | |
cfdb727a | 94 | |
eb1bab5b BH |
95 | /** |
96 | * Retrieves the UST provider information from the node. | |
cfdb727a AM |
97 | * |
98 | * @param monitor | |
99 | * - a progress monitor | |
bbb3538a | 100 | * @return the UST provider information. |
eb1bab5b | 101 | * @throws ExecutionException |
cfdb727a | 102 | * If the command fails |
eb1bab5b | 103 | */ |
cfdb727a AM |
104 | public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) |
105 | throws ExecutionException; | |
106 | ||
bbb3538a BH |
107 | /** |
108 | * Creates a session with given session name and location. | |
cfdb727a AM |
109 | * |
110 | * @param sessionName | |
111 | * - a session name to create | |
112 | * @param sessionPath | |
113 | * - a path for storing the traces (use null for default) | |
114 | * @param monitor | |
115 | * - a progress monitor | |
bbb3538a BH |
116 | * @return the session information |
117 | * @throws ExecutionException | |
cfdb727a | 118 | * If the command fails |
bbb3538a | 119 | */ |
cfdb727a AM |
120 | public ISessionInfo createSession(String sessionName, String sessionPath, |
121 | IProgressMonitor monitor) throws ExecutionException; | |
122 | ||
f3b33d40 BH |
123 | /** |
124 | * Creates a session with given session name and location. | |
125 | * | |
126 | * @param sessionName | |
127 | * - a session name to create | |
128 | * @param sessionPath | |
129 | * - a path for storing the traces (use null for default) | |
130 | * @param noConsumer | |
131 | * - a flag to indicate no consumer | |
132 | * @param disableConsumer | |
133 | * - a flag to disable consumer | |
134 | * @param monitor | |
135 | * - a progress monitor | |
136 | * @return the session information | |
137 | * @throws ExecutionException | |
138 | * If the command fails | |
139 | */ | |
140 | public ISessionInfo createSession(String sessionName, String sessionPath, boolean noConsumer, boolean disableConsumer, | |
141 | IProgressMonitor monitor) throws ExecutionException; | |
142 | ||
143 | ||
144 | /** | |
145 | * Creates a session with given session name and location. | |
146 | * | |
147 | * @param sessionName | |
148 | * - a session name to create | |
149 | * @param networkUrl | |
150 | * - a network URL for common definition of data and control channel | |
151 | * or null if separate definition of data and control channel | |
152 | * @param controlUrl | |
153 | * - a URL for control channel (networkUrl has to be null, dataUrl has to be set) | |
154 | * @param dataUrl | |
155 | * - a URL for data channel (networkUrl has to be null, controlUrl has to be set) | |
156 | * @param noConsumer | |
157 | * - a flag to indicate no consumer | |
158 | * @param disableConsumer | |
159 | * - a flag to disable consumer | |
160 | * @param monitor | |
161 | * - a progress monitor | |
162 | * @return the session information | |
163 | * @throws ExecutionException | |
164 | * If the command fails | |
165 | */ | |
166 | public ISessionInfo createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, boolean noConsumer, boolean disableConsumer, | |
167 | IProgressMonitor monitor) throws ExecutionException; | |
168 | ||
bbb3538a | 169 | /** |
cfdb727a AM |
170 | * Destroys a session with given session name. |
171 | * | |
172 | * @param sessionName | |
173 | * - a session name to destroy | |
174 | * @param monitor | |
175 | * - a progress monitor | |
bbb3538a | 176 | * @throws ExecutionException |
cfdb727a | 177 | * If the command fails |
bbb3538a | 178 | */ |
cfdb727a AM |
179 | public void destroySession(String sessionName, IProgressMonitor monitor) |
180 | throws ExecutionException; | |
bbb3538a BH |
181 | |
182 | /** | |
cfdb727a AM |
183 | * Starts a session with given session name. |
184 | * | |
185 | * @param sessionName | |
186 | * - a session name to start | |
187 | * @param monitor | |
188 | * - a progress monitor | |
bbb3538a | 189 | * @throws ExecutionException |
cfdb727a AM |
190 | * If the command fails |
191 | */ | |
192 | public void startSession(String sessionName, IProgressMonitor monitor) | |
193 | throws ExecutionException; | |
bbb3538a | 194 | |
cfdb727a AM |
195 | /** |
196 | * Stops a session with given session name. | |
197 | * | |
198 | * @param sessionName | |
199 | * - a session name to stop | |
200 | * @param monitor | |
201 | * - a progress monitor | |
202 | * @throws ExecutionException | |
203 | * If the command fails | |
204 | */ | |
205 | public void stopSession(String sessionName, IProgressMonitor monitor) | |
206 | throws ExecutionException; | |
bbb3538a | 207 | |
cfdb727a AM |
208 | /** |
209 | * Enables a list of channels for given session and given channel | |
210 | * information (configuration). | |
211 | * | |
212 | * @param sessionName | |
213 | * - a session name to create | |
214 | * @param channelNames | |
215 | * - a list of channel names to be enabled | |
216 | * @param isKernel | |
217 | * - a flag to indicate Kernel or UST (true for Kernel, false for | |
218 | * UST) | |
219 | * @param info | |
220 | * - channel information used for creation of a channel (or null | |
221 | * for default) | |
222 | * @param monitor | |
223 | * - a progress monitor | |
224 | * @throws ExecutionException | |
225 | * If the command fails | |
226 | */ | |
227 | public void enableChannels(String sessionName, List<String> channelNames, | |
228 | boolean isKernel, IChannelInfo info, IProgressMonitor monitor) | |
229 | throws ExecutionException; | |
bbb3538a | 230 | |
cfdb727a AM |
231 | /** |
232 | * Disables a list of channels for given session and given channel | |
233 | * information (configuration). | |
234 | * | |
235 | * @param sessionName | |
236 | * - a session name to create | |
237 | * @param channelNames | |
238 | * - a list of channel names to be enabled | |
239 | * @param isKernel | |
240 | * - a flag to indicate Kernel or UST (true for Kernel, false for | |
241 | * UST) | |
242 | * @param monitor | |
243 | * - a progress monitor | |
244 | * @throws ExecutionException | |
245 | * If the command fails | |
246 | */ | |
247 | public void disableChannels(String sessionName, List<String> channelNames, | |
248 | boolean isKernel, IProgressMonitor monitor) | |
249 | throws ExecutionException; | |
6503ae0f BH |
250 | |
251 | /** | |
252 | * Enables a list of events with no additional parameters. | |
cfdb727a AM |
253 | * |
254 | * @param sessionName | |
255 | * - a session name | |
256 | * @param channelName | |
257 | * - a channel name or null for default channel | |
258 | * @param eventNames | |
259 | * - a list of event names to be enabled, or null (list of size = | |
260 | * 0)for all events . | |
261 | * @param isKernel | |
262 | * - a flag for indicating kernel or UST. | |
d4514365 BH |
263 | * @param filterExpression |
264 | * - a filter expression | |
cfdb727a AM |
265 | * @param monitor |
266 | * - a progress monitor | |
6503ae0f | 267 | * @throws ExecutionException |
cfdb727a | 268 | * If the command fails |
6503ae0f | 269 | */ |
cfdb727a | 270 | public void enableEvents(String sessionName, String channelName, |
d4514365 BH |
271 | List<String> eventNames, boolean isKernel, String filterExpression, |
272 | IProgressMonitor monitor) | |
cfdb727a | 273 | throws ExecutionException; |
498704b3 | 274 | |
d4514365 | 275 | |
498704b3 BH |
276 | /** |
277 | * Enables all syscall events. | |
cfdb727a AM |
278 | * |
279 | * @param sessionName | |
280 | * - a session name | |
281 | * @param channelName | |
282 | * - a channel name or null for default channel | |
283 | * @param monitor | |
284 | * - a progress monitor | |
498704b3 | 285 | * @throws ExecutionException |
cfdb727a | 286 | * If the command fails |
498704b3 | 287 | */ |
cfdb727a AM |
288 | public void enableSyscalls(String sessionName, String channelName, |
289 | IProgressMonitor monitor) throws ExecutionException; | |
498704b3 BH |
290 | |
291 | /** | |
d132bcc7 | 292 | * Enables a dynamic probe or dynamic function entry/return probe. |
cfdb727a AM |
293 | * |
294 | * @param sessionName | |
295 | * - a session name | |
296 | * @param channelName | |
297 | * - a channel name or null for default channel | |
298 | * @param eventName | |
299 | * - a event name | |
300 | * @param isFunction | |
301 | * - true for dynamic function entry/return probe else false | |
302 | * @param probe | |
303 | * - a dynamic probe information | |
304 | * @param monitor | |
305 | * - a progress monitor | |
498704b3 | 306 | * @throws ExecutionException |
cfdb727a | 307 | * If the command fails |
498704b3 | 308 | */ |
cfdb727a AM |
309 | public void enableProbe(String sessionName, String channelName, |
310 | String eventName, boolean isFunction, String probe, | |
311 | IProgressMonitor monitor) throws ExecutionException; | |
498704b3 | 312 | |
ccc66d01 BH |
313 | /** |
314 | * Enables events using log level | |
cfdb727a AM |
315 | * |
316 | * @param sessionName | |
317 | * - a session name | |
318 | * @param channelName | |
319 | * - a channel name (null for default channel) | |
320 | * @param eventName | |
321 | * - a event name | |
322 | * @param logLevelType | |
323 | * - a log level type | |
324 | * @param level | |
325 | * - a log level | |
d4514365 BH |
326 | * @param filterExpression |
327 | * - a filter expression | |
cfdb727a AM |
328 | * @param monitor |
329 | * - a progress monitor | |
ccc66d01 | 330 | * @throws ExecutionException |
cfdb727a | 331 | * If the command fails |
ccc66d01 | 332 | */ |
cfdb727a AM |
333 | public void enableLogLevel(String sessionName, String channelName, |
334 | String eventName, LogLevelType logLevelType, TraceLogLevel level, | |
d4514365 | 335 | String filterExpression, |
cfdb727a AM |
336 | IProgressMonitor monitor) throws ExecutionException; |
337 | ||
6503ae0f BH |
338 | /** |
339 | * Disables a list of events with no additional parameters. | |
cfdb727a AM |
340 | * |
341 | * @param sessionName | |
342 | * - a session name | |
343 | * @param channelName | |
344 | * - a channel name (null for default channel) | |
345 | * @param eventNames | |
346 | * - a list of event names to enabled. | |
347 | * @param isKernel | |
348 | * - a flag for indicating kernel or UST. | |
349 | * @param monitor | |
350 | * - a progress monitor | |
6503ae0f | 351 | * @throws ExecutionException |
cfdb727a | 352 | * If the command fails |
6503ae0f | 353 | */ |
cfdb727a AM |
354 | public void disableEvent(String sessionName, String channelName, |
355 | List<String> eventNames, boolean isKernel, IProgressMonitor monitor) | |
356 | throws ExecutionException; | |
357 | ||
b793fbe1 BH |
358 | /** |
359 | * Gets all available context names to be added to channels/events. | |
cfdb727a | 360 | * |
b793fbe1 | 361 | * @param monitor |
cfdb727a | 362 | * The progress monitor |
b793fbe1 | 363 | * @return the list of available contexts |
cfdb727a AM |
364 | * @throws ExecutionException |
365 | * If the command fails | |
b793fbe1 | 366 | */ |
cfdb727a AM |
367 | public List<String> getContextList(IProgressMonitor monitor) |
368 | throws ExecutionException; | |
369 | ||
b793fbe1 BH |
370 | /** |
371 | * Add contexts to given channels and or events | |
cfdb727a AM |
372 | * |
373 | * @param sessionName | |
374 | * - a session name | |
375 | * @param channelName | |
376 | * - a channel name (null for all channels) | |
377 | * @param eventName | |
378 | * - a event name (null for all events) | |
379 | * @param isKernel | |
380 | * - a flag for indicating kernel or UST. | |
381 | * @param contexts | |
382 | * - a list of name of contexts to add | |
383 | * @param monitor | |
384 | * - a progress monitor | |
b793fbe1 | 385 | * @throws ExecutionException |
cfdb727a | 386 | * If the command fails |
b793fbe1 | 387 | */ |
cfdb727a AM |
388 | public void addContexts(String sessionName, String channelName, |
389 | String eventName, boolean isKernel, List<String> contexts, | |
390 | IProgressMonitor monitor) throws ExecutionException; | |
391 | ||
b720ac44 BH |
392 | /** |
393 | * Executes calibrate command to quantify LTTng overhead. | |
cfdb727a AM |
394 | * |
395 | * @param isKernel | |
396 | * - a flag for indicating kernel or UST. | |
397 | * @param monitor | |
398 | * - a progress monitor | |
b720ac44 | 399 | * @throws ExecutionException |
cfdb727a | 400 | * If the command fails |
b720ac44 | 401 | */ |
cfdb727a AM |
402 | public void calibrate(boolean isKernel, IProgressMonitor monitor) |
403 | throws ExecutionException; | |
eb1bab5b | 404 | } |