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