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 | **********************************************************************/ |
8e8c0226 | 13 | package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; |
eb1bab5b BH |
14 | |
15 | import java.util.List; | |
16 | ||
17 | import org.eclipse.core.commands.ExecutionException; | |
18 | import org.eclipse.core.runtime.IProgressMonitor; | |
8e8c0226 AM |
19 | import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; |
20 | import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; | |
21 | import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; | |
22 | import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; | |
23 | import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; | |
24 | import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; | |
25 | import org.eclipse.linuxtools.internal.lttng2.control.core.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 | 124 | * |
f7d4d450 MAL |
125 | * @param sessionInfo |
126 | * the session information used to create the session | |
cfdb727a AM |
127 | * @param monitor |
128 | * - a progress monitor | |
f3b33d40 | 129 | * |
f3b33d40 BH |
130 | * @return the session information |
131 | * @throws ExecutionException | |
132 | * If the command fails | |
133 | */ | |
f7d4d450 | 134 | ISessionInfo createSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException; |
f3b33d40 | 135 | |
bbb3538a | 136 | /** |
cfdb727a AM |
137 | * Destroys a session with given session name. |
138 | * | |
139 | * @param sessionName | |
140 | * - a session name to destroy | |
141 | * @param monitor | |
142 | * - a progress monitor | |
bbb3538a | 143 | * @throws ExecutionException |
cfdb727a | 144 | * If the command fails |
bbb3538a | 145 | */ |
046b6849 | 146 | void destroySession(String sessionName, IProgressMonitor monitor) |
cfdb727a | 147 | throws ExecutionException; |
bbb3538a BH |
148 | |
149 | /** | |
cfdb727a AM |
150 | * Starts a session with given session name. |
151 | * | |
152 | * @param sessionName | |
153 | * - a session name to start | |
154 | * @param monitor | |
155 | * - a progress monitor | |
bbb3538a | 156 | * @throws ExecutionException |
cfdb727a AM |
157 | * If the command fails |
158 | */ | |
046b6849 | 159 | void startSession(String sessionName, IProgressMonitor monitor) |
cfdb727a | 160 | throws ExecutionException; |
bbb3538a | 161 | |
cfdb727a AM |
162 | /** |
163 | * Stops a session with given session name. | |
164 | * | |
165 | * @param sessionName | |
166 | * - a session name to stop | |
167 | * @param monitor | |
168 | * - a progress monitor | |
169 | * @throws ExecutionException | |
170 | * If the command fails | |
171 | */ | |
046b6849 | 172 | void stopSession(String sessionName, IProgressMonitor monitor) |
cfdb727a | 173 | throws ExecutionException; |
bbb3538a | 174 | |
cfdb727a AM |
175 | /** |
176 | * Enables a list of channels for given session and given channel | |
177 | * information (configuration). | |
178 | * | |
179 | * @param sessionName | |
180 | * - a session name to create | |
181 | * @param channelNames | |
182 | * - a list of channel names to be enabled | |
183 | * @param isKernel | |
184 | * - a flag to indicate Kernel or UST (true for Kernel, false for | |
185 | * UST) | |
186 | * @param info | |
187 | * - channel information used for creation of a channel (or null | |
188 | * for default) | |
189 | * @param monitor | |
190 | * - a progress monitor | |
191 | * @throws ExecutionException | |
192 | * If the command fails | |
193 | */ | |
046b6849 | 194 | void enableChannels(String sessionName, List<String> channelNames, |
cfdb727a AM |
195 | boolean isKernel, IChannelInfo info, IProgressMonitor monitor) |
196 | throws ExecutionException; | |
bbb3538a | 197 | |
cfdb727a AM |
198 | /** |
199 | * Disables a list of channels for given session and given channel | |
200 | * information (configuration). | |
201 | * | |
202 | * @param sessionName | |
203 | * - a session name to create | |
204 | * @param channelNames | |
205 | * - a list of channel names to be enabled | |
206 | * @param isKernel | |
207 | * - a flag to indicate Kernel or UST (true for Kernel, false for | |
208 | * UST) | |
209 | * @param monitor | |
210 | * - a progress monitor | |
211 | * @throws ExecutionException | |
212 | * If the command fails | |
213 | */ | |
046b6849 | 214 | void disableChannels(String sessionName, List<String> channelNames, |
cfdb727a AM |
215 | boolean isKernel, IProgressMonitor monitor) |
216 | throws ExecutionException; | |
6503ae0f BH |
217 | |
218 | /** | |
219 | * Enables a list of events with no additional parameters. | |
cfdb727a AM |
220 | * |
221 | * @param sessionName | |
222 | * - a session name | |
223 | * @param channelName | |
224 | * - a channel name or null for default channel | |
225 | * @param eventNames | |
226 | * - a list of event names to be enabled, or null (list of size = | |
227 | * 0)for all events . | |
228 | * @param isKernel | |
229 | * - a flag for indicating kernel or UST. | |
d4514365 BH |
230 | * @param filterExpression |
231 | * - a filter expression | |
cfdb727a AM |
232 | * @param monitor |
233 | * - a progress monitor | |
6503ae0f | 234 | * @throws ExecutionException |
cfdb727a | 235 | * If the command fails |
6503ae0f | 236 | */ |
046b6849 | 237 | void enableEvents(String sessionName, String channelName, |
d4514365 BH |
238 | List<String> eventNames, boolean isKernel, String filterExpression, |
239 | IProgressMonitor monitor) | |
cfdb727a | 240 | throws ExecutionException; |
498704b3 | 241 | |
d4514365 | 242 | |
498704b3 BH |
243 | /** |
244 | * Enables all syscall events. | |
cfdb727a AM |
245 | * |
246 | * @param sessionName | |
247 | * - a session name | |
248 | * @param channelName | |
249 | * - a channel name or null for default channel | |
250 | * @param monitor | |
251 | * - a progress monitor | |
498704b3 | 252 | * @throws ExecutionException |
cfdb727a | 253 | * If the command fails |
498704b3 | 254 | */ |
046b6849 | 255 | void enableSyscalls(String sessionName, String channelName, |
cfdb727a | 256 | IProgressMonitor monitor) throws ExecutionException; |
498704b3 BH |
257 | |
258 | /** | |
d132bcc7 | 259 | * Enables a dynamic probe or dynamic function entry/return probe. |
cfdb727a AM |
260 | * |
261 | * @param sessionName | |
262 | * - a session name | |
263 | * @param channelName | |
264 | * - a channel name or null for default channel | |
265 | * @param eventName | |
266 | * - a event name | |
267 | * @param isFunction | |
268 | * - true for dynamic function entry/return probe else false | |
269 | * @param probe | |
270 | * - a dynamic probe information | |
271 | * @param monitor | |
272 | * - a progress monitor | |
498704b3 | 273 | * @throws ExecutionException |
cfdb727a | 274 | * If the command fails |
498704b3 | 275 | */ |
046b6849 | 276 | void enableProbe(String sessionName, String channelName, |
cfdb727a AM |
277 | String eventName, boolean isFunction, String probe, |
278 | IProgressMonitor monitor) throws ExecutionException; | |
498704b3 | 279 | |
ccc66d01 BH |
280 | /** |
281 | * Enables events using log level | |
cfdb727a AM |
282 | * |
283 | * @param sessionName | |
284 | * - a session name | |
285 | * @param channelName | |
286 | * - a channel name (null for default channel) | |
287 | * @param eventName | |
288 | * - a event name | |
289 | * @param logLevelType | |
290 | * - a log level type | |
291 | * @param level | |
292 | * - a log level | |
d4514365 BH |
293 | * @param filterExpression |
294 | * - a filter expression | |
cfdb727a AM |
295 | * @param monitor |
296 | * - a progress monitor | |
ccc66d01 | 297 | * @throws ExecutionException |
cfdb727a | 298 | * If the command fails |
ccc66d01 | 299 | */ |
046b6849 | 300 | void enableLogLevel(String sessionName, String channelName, |
cfdb727a | 301 | String eventName, LogLevelType logLevelType, TraceLogLevel level, |
d4514365 | 302 | String filterExpression, |
cfdb727a AM |
303 | IProgressMonitor monitor) throws ExecutionException; |
304 | ||
6503ae0f BH |
305 | /** |
306 | * Disables a list of events with no additional parameters. | |
cfdb727a AM |
307 | * |
308 | * @param sessionName | |
309 | * - a session name | |
310 | * @param channelName | |
311 | * - a channel name (null for default channel) | |
312 | * @param eventNames | |
313 | * - a list of event names to enabled. | |
314 | * @param isKernel | |
315 | * - a flag for indicating kernel or UST. | |
316 | * @param monitor | |
317 | * - a progress monitor | |
6503ae0f | 318 | * @throws ExecutionException |
cfdb727a | 319 | * If the command fails |
6503ae0f | 320 | */ |
046b6849 | 321 | void disableEvent(String sessionName, String channelName, |
cfdb727a AM |
322 | List<String> eventNames, boolean isKernel, IProgressMonitor monitor) |
323 | throws ExecutionException; | |
324 | ||
b793fbe1 BH |
325 | /** |
326 | * Gets all available context names to be added to channels/events. | |
cfdb727a | 327 | * |
b793fbe1 | 328 | * @param monitor |
cfdb727a | 329 | * The progress monitor |
b793fbe1 | 330 | * @return the list of available contexts |
cfdb727a AM |
331 | * @throws ExecutionException |
332 | * If the command fails | |
b793fbe1 | 333 | */ |
046b6849 | 334 | List<String> getContextList(IProgressMonitor monitor) |
cfdb727a AM |
335 | throws ExecutionException; |
336 | ||
b793fbe1 BH |
337 | /** |
338 | * Add contexts to given channels and or events | |
cfdb727a AM |
339 | * |
340 | * @param sessionName | |
341 | * - a session name | |
342 | * @param channelName | |
343 | * - a channel name (null for all channels) | |
344 | * @param eventName | |
345 | * - a event name (null for all events) | |
346 | * @param isKernel | |
347 | * - a flag for indicating kernel or UST. | |
348 | * @param contexts | |
349 | * - a list of name of contexts to add | |
350 | * @param monitor | |
351 | * - a progress monitor | |
b793fbe1 | 352 | * @throws ExecutionException |
cfdb727a | 353 | * If the command fails |
b793fbe1 | 354 | */ |
046b6849 | 355 | void addContexts(String sessionName, String channelName, |
cfdb727a AM |
356 | String eventName, boolean isKernel, List<String> contexts, |
357 | IProgressMonitor monitor) throws ExecutionException; | |
358 | ||
b720ac44 BH |
359 | /** |
360 | * Executes calibrate command to quantify LTTng overhead. | |
cfdb727a AM |
361 | * |
362 | * @param isKernel | |
363 | * - a flag for indicating kernel or UST. | |
364 | * @param monitor | |
365 | * - a progress monitor | |
b720ac44 | 366 | * @throws ExecutionException |
cfdb727a | 367 | * If the command fails |
b720ac44 | 368 | */ |
046b6849 | 369 | void calibrate(boolean isKernel, IProgressMonitor monitor) |
cfdb727a | 370 | throws ExecutionException; |
589d0d33 BH |
371 | |
372 | /** | |
373 | * Records a snapshot. | |
374 | * | |
375 | * @param sessionName | |
376 | * - a session name | |
377 | * @param monitor | |
378 | * - a progress monitor | |
379 | * @throws ExecutionException | |
380 | * If the command fails | |
381 | */ | |
382 | void recordSnapshot(String sessionName, IProgressMonitor monitor) | |
383 | throws ExecutionException; | |
64a37b87 BH |
384 | |
385 | /** | |
386 | * Executes a list of commands | |
387 | * | |
388 | * @param monitor | |
389 | * - a progress monitor | |
390 | * @param commands | |
391 | * - array of commands | |
392 | * @throws ExecutionException | |
393 | * If a command fails | |
394 | */ | |
395 | void runCommands(IProgressMonitor monitor, List<String> commands) | |
396 | throws ExecutionException; | |
eb1bab5b | 397 | } |