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