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