1 /**********************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
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
10 * Bernd Hufmann - Initial API and implementation
11 * Bernd Hufmann - Updated for support of LTTng Tools 2.1
12 **********************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.service
;
15 import java
.util
.Collections
;
16 import java
.util
.List
;
18 import org
.eclipse
.core
.commands
.ExecutionException
;
19 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
20 import org
.eclipse
.jdt
.annotation
.NonNull
;
21 import org
.eclipse
.jdt
.annotation
.Nullable
;
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
;
33 * Interface for LTTng trace control command service.
36 * @author Bernd Hufmann
38 public interface ILttngControlService
{
42 * List to enable all events
44 @NonNull List
<String
> ALL_EVENTS
= Collections
.singletonList("*"); //$NON-NLS-1$
47 * @return the LTTng version object
49 @NonNull LttngVersion
getVersion();
52 * @return the version string
54 @NonNull String
getVersionString();
57 * Checks if given version is supported by this ILTTngControlService implementation.
59 * @param version The version to check
60 * @return <code>true</code> if version is supported else <code>false</code>
62 boolean isVersionSupported(String version
);
65 * Retrieves the existing sessions names from the node.
68 * - a progress monitor
69 * @return a list of session names.
70 * @throws ExecutionException
71 * If the command fails
73 @NonNull List
<String
> getSessionNames(IProgressMonitor monitor
) throws ExecutionException
;
76 * Retrieves the session information with the given name the node.
81 * - a progress monitor
82 * @return session information
83 * @throws ExecutionException
84 * If the command fails
86 @Nullable ISessionInfo
getSession(String sessionName
, IProgressMonitor monitor
)
87 throws ExecutionException
;
90 * Retrieves the snapshot output information from the node
94 * - a progress monitor
95 * @return snapshot output information
96 * @throws ExecutionException
99 @Nullable ISnapshotInfo
getSnapshotInfo(String sessionName
, IProgressMonitor monitor
)
100 throws ExecutionException
;
103 * Retrieves the kernel provider information (i.e. the kernel events)
106 * - a progress monitor
107 * @return the list of existing kernel events.
108 * @throws ExecutionException
109 * If the command fails
111 @NonNull List
<IBaseEventInfo
> getKernelProvider(IProgressMonitor monitor
)
112 throws ExecutionException
;
115 * Retrieves the UST provider information from the node.
117 * @return - the UST provider information.
118 * @throws ExecutionException
119 * If the command fails
121 @NonNull public List
<IUstProviderInfo
> getUstProvider() throws ExecutionException
;
124 * Retrieves the UST provider information from the node.
127 * - a progress monitor
128 * @return the UST provider information.
129 * @throws ExecutionException
130 * If the command fails
132 @NonNull List
<IUstProviderInfo
> getUstProvider(IProgressMonitor monitor
)
133 throws ExecutionException
;
136 * Creates a session with given session name and location.
139 * the session information used to create the session
141 * - a progress monitor
143 * @return the session information
144 * @throws ExecutionException
145 * If the command fails
147 @Nullable ISessionInfo
createSession(ISessionInfo sessionInfo
, IProgressMonitor monitor
) throws ExecutionException
;
150 * Destroys a session with given session name.
153 * - a session name to destroy
155 * - a progress monitor
156 * @throws ExecutionException
157 * If the command fails
159 void destroySession(String sessionName
, IProgressMonitor monitor
)
160 throws ExecutionException
;
163 * Starts a session with given session name.
166 * - a session name to start
168 * - a progress monitor
169 * @throws ExecutionException
170 * If the command fails
172 void startSession(String sessionName
, IProgressMonitor monitor
)
173 throws ExecutionException
;
176 * Stops a session with given session name.
179 * - a session name to stop
181 * - a progress monitor
182 * @throws ExecutionException
183 * If the command fails
185 void stopSession(String sessionName
, IProgressMonitor monitor
)
186 throws ExecutionException
;
189 * Enables a list of channels for given session and given channel
190 * information (configuration).
193 * - a session name to create
194 * @param channelNames
195 * - a list of channel names to be enabled
197 * - a flag to indicate Kernel or UST (true for Kernel, false for
200 * - channel information used for creation of a channel (or null
203 * - a progress monitor
204 * @throws ExecutionException
205 * If the command fails
207 void enableChannels(String sessionName
, List
<String
> channelNames
,
208 boolean isKernel
, IChannelInfo info
, IProgressMonitor monitor
)
209 throws ExecutionException
;
212 * Disables a list of channels for given session and given channel
213 * information (configuration).
216 * - a session name to create
217 * @param channelNames
218 * - a list of channel names to be enabled
220 * - a flag to indicate Kernel or UST (true for Kernel, false for
223 * - a progress monitor
224 * @throws ExecutionException
225 * If the command fails
227 void disableChannels(String sessionName
, List
<String
> channelNames
,
228 boolean isKernel
, IProgressMonitor monitor
)
229 throws ExecutionException
;
232 * Enables a list of events with no additional parameters.
237 * - a channel name or null for default channel
239 * - a list of event names to be enabled, or null (list of size =
242 * - a flag for indicating kernel or UST.
243 * @param filterExpression
244 * - a filter expression
246 * - a progress monitor
247 * @throws ExecutionException
248 * If the command fails
250 void enableEvents(String sessionName
, String channelName
,
251 List
<String
> eventNames
, boolean isKernel
, String filterExpression
,
252 IProgressMonitor monitor
)
253 throws ExecutionException
;
257 * Enables all syscall events.
262 * - a channel name or null for default channel
264 * - a progress monitor
265 * @throws ExecutionException
266 * If the command fails
268 void enableSyscalls(String sessionName
, String channelName
,
269 IProgressMonitor monitor
) throws ExecutionException
;
272 * Enables a dynamic probe or dynamic function entry/return probe.
277 * - a channel name or null for default channel
281 * - true for dynamic function entry/return probe else false
283 * - a dynamic probe information
285 * - a progress monitor
286 * @throws ExecutionException
287 * If the command fails
289 void enableProbe(String sessionName
, String channelName
,
290 String eventName
, boolean isFunction
, String probe
,
291 IProgressMonitor monitor
) throws ExecutionException
;
294 * Enables events using log level
299 * - a channel name (null for default channel)
302 * @param logLevelType
306 * @param filterExpression
307 * - a filter expression
309 * - a progress monitor
310 * @throws ExecutionException
311 * If the command fails
313 void enableLogLevel(String sessionName
, String channelName
,
314 String eventName
, LogLevelType logLevelType
, TraceLogLevel level
,
315 String filterExpression
,
316 IProgressMonitor monitor
) throws ExecutionException
;
319 * Disables a list of events with no additional parameters.
324 * - a channel name (null for default channel)
326 * - a list of event names to enabled.
328 * - a flag for indicating kernel or UST.
330 * - a progress monitor
331 * @throws ExecutionException
332 * If the command fails
334 void disableEvent(String sessionName
, String channelName
,
335 List
<String
> eventNames
, boolean isKernel
, IProgressMonitor monitor
)
336 throws ExecutionException
;
339 * Gets all available context names to be added to channels/events.
342 * The progress monitor
343 * @return the list of available contexts
344 * @throws ExecutionException
345 * If the command fails
347 @NonNull List
<String
> getContextList(IProgressMonitor monitor
)
348 throws ExecutionException
;
351 * Add contexts to given channels and or events
356 * - a channel name (null for all channels)
358 * - a event name (null for all events)
360 * - a flag for indicating kernel or UST.
362 * - a list of name of contexts to add
364 * - a progress monitor
365 * @throws ExecutionException
366 * If the command fails
368 void addContexts(String sessionName
, String channelName
,
369 String eventName
, boolean isKernel
, List
<String
> contexts
,
370 IProgressMonitor monitor
) throws ExecutionException
;
373 * Records a snapshot.
378 * - a progress monitor
379 * @throws ExecutionException
380 * If the command fails
382 void recordSnapshot(String sessionName
, IProgressMonitor monitor
)
383 throws ExecutionException
;
386 * Executes a list of commands
389 * - a progress monitor
391 * - array of commands
392 * @throws ExecutionException
395 void runCommands(IProgressMonitor monitor
, List
<String
> commands
)
396 throws ExecutionException
;
399 * Load all or a given session.
402 * a input path to load session from or null for load all from default
404 * flag whether to overwrite existing or not
407 * @throws ExecutionException
408 * If the command fails
410 void loadSession(@Nullable String inputPath
, boolean isForce
, IProgressMonitor monitor
)
411 throws ExecutionException
;
414 * Save all or a given session.
417 * a session name to save or null for all
419 * a path to save session or null for default location
421 * flag whether to overwrite existing or not
424 * @throws ExecutionException
425 * If the command fails
427 void saveSession(@Nullable String session
, @Nullable String outputPath
, boolean isForce
, IProgressMonitor monitor
)
428 throws ExecutionException
;