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
.TraceDomainType
;
23 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.IBaseEventInfo
;
24 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.IChannelInfo
;
25 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.ISessionInfo
;
26 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.ISnapshotInfo
;
27 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.ITraceLogLevel
;
28 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.IUstProviderInfo
;
29 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.LogLevelType
;
34 * Interface for LTTng trace control command service.
37 * @author Bernd Hufmann
39 public interface ILttngControlService
{
43 * List to enable all events
45 @NonNull List
<String
> ALL_EVENTS
= Collections
.singletonList("*"); //$NON-NLS-1$
48 * @return the LTTng version object
50 @NonNull LttngVersion
getVersion();
53 * @return the version string
55 @NonNull String
getVersionString();
58 * Checks if given version is supported by this ILTTngControlService implementation.
60 * @param version The version to check
61 * @return <code>true</code> if version is supported else <code>false</code>
63 boolean isVersionSupported(String version
);
66 * Retrieves the existing sessions names from the node.
69 * - a progress monitor
70 * @return a list of session names.
71 * @throws ExecutionException
72 * If the command fails
74 @NonNull List
<String
> getSessionNames(IProgressMonitor monitor
) throws ExecutionException
;
77 * Retrieves the session information with the given name the node.
82 * - a progress monitor
83 * @return session information
84 * @throws ExecutionException
85 * If the command fails
87 @Nullable ISessionInfo
getSession(String sessionName
, IProgressMonitor monitor
)
88 throws ExecutionException
;
91 * Retrieves the snapshot output information from the node
95 * - a progress monitor
96 * @return snapshot output information
97 * @throws ExecutionException
100 @Nullable ISnapshotInfo
getSnapshotInfo(String sessionName
, IProgressMonitor monitor
)
101 throws ExecutionException
;
104 * Retrieves the kernel provider information (i.e. the kernel events)
107 * - a progress monitor
108 * @return the list of existing kernel events.
109 * @throws ExecutionException
110 * If the command fails
112 @NonNull List
<IBaseEventInfo
> getKernelProvider(IProgressMonitor monitor
)
113 throws ExecutionException
;
116 * Retrieves the UST provider information from the node.
118 * @return - the UST provider information.
119 * @throws ExecutionException
120 * If the command fails
122 @NonNull public List
<IUstProviderInfo
> getUstProvider() throws ExecutionException
;
125 * Retrieves the UST provider information from the node.
128 * - a progress monitor
129 * @return the UST provider information.
130 * @throws ExecutionException
131 * If the command fails
133 @NonNull List
<IUstProviderInfo
> getUstProvider(IProgressMonitor monitor
)
134 throws ExecutionException
;
137 * Creates a session with given session name and location.
140 * the session information used to create the session
142 * - a progress monitor
144 * @return the session information
145 * @throws ExecutionException
146 * If the command fails
148 @Nullable ISessionInfo
createSession(ISessionInfo sessionInfo
, IProgressMonitor monitor
) throws ExecutionException
;
151 * Destroys a session with given session name.
154 * - a session name to destroy
156 * - a progress monitor
157 * @throws ExecutionException
158 * If the command fails
160 void destroySession(String sessionName
, IProgressMonitor monitor
)
161 throws ExecutionException
;
164 * Starts a session with given session name.
167 * - a session name to start
169 * - a progress monitor
170 * @throws ExecutionException
171 * If the command fails
173 void startSession(String sessionName
, IProgressMonitor monitor
)
174 throws ExecutionException
;
177 * Stops a session with given session name.
180 * - a session name to stop
182 * - a progress monitor
183 * @throws ExecutionException
184 * If the command fails
186 void stopSession(String sessionName
, IProgressMonitor monitor
)
187 throws ExecutionException
;
190 * Enables a list of channels for given session and given channel
191 * information (configuration).
194 * - a session name to create
195 * @param channelNames
196 * - a list of channel names to be enabled
198 * - indicate the domain type ({@link TraceDomainType})
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 TraceDomainType domain
, 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 * - indicate the domain type ({@link TraceDomainType})
222 * - a progress monitor
223 * @throws ExecutionException
224 * If the command fails
226 void disableChannels(String sessionName
, List
<String
> channelNames
,
227 TraceDomainType domain
, IProgressMonitor monitor
)
228 throws ExecutionException
;
231 * Enables a list of events with no additional parameters.
236 * - a channel name or null for default channel
238 * - a list of event names to be enabled, or null (list of size =
241 * - indicate the domain type ({@link TraceDomainType})
242 * @param filterExpression
243 * - a filter expression
244 * @param excludedEvents
245 * - a list of event names to be excluded, or null
247 * - a progress monitor
248 * @throws ExecutionException
249 * If the command fails
251 void enableEvents(String sessionName
, String channelName
,
252 List
<String
> eventNames
, TraceDomainType domain
, String filterExpression
, List
<String
> excludedEvents
,
253 IProgressMonitor monitor
)
254 throws ExecutionException
;
258 * Enables all syscall events.
263 * - a channel name or null for default channel
265 * - a list of event names to be enabled, or null or empty List
268 * - a progress monitor
269 * @throws ExecutionException
270 * If the command fails
272 void enableSyscalls(String sessionName
, String channelName
,
273 List
<String
> eventNames
, IProgressMonitor monitor
)
274 throws ExecutionException
;
277 * Enables a dynamic probe or dynamic function entry/return probe.
282 * - a channel name or null for default channel
286 * - true for dynamic function entry/return probe else false
288 * - a dynamic probe information
290 * - a progress monitor
291 * @throws ExecutionException
292 * If the command fails
294 void enableProbe(String sessionName
, String channelName
,
295 String eventName
, boolean isFunction
, String probe
,
296 IProgressMonitor monitor
) throws ExecutionException
;
299 * Enables events using log level
304 * - a channel name (null for default channel)
306 * - a list of event names
307 * @param logLevelType
311 * @param filterExpression
312 * - a filter expression
316 * - a progress monitor
317 * @throws ExecutionException
318 * If the command fails
320 void enableLogLevel(String sessionName
, String channelName
,
321 List
<String
> eventNames
, LogLevelType logLevelType
, ITraceLogLevel level
,
322 String filterExpression
, TraceDomainType domain
,
323 IProgressMonitor monitor
) throws ExecutionException
;
326 * Disables a list of events with no additional parameters.
331 * - a channel name (null for default channel)
333 * - a list of event names to enabled.
335 * - indicate the domain type ({@link TraceDomainType})
337 * - a progress monitor
338 * @throws ExecutionException
339 * If the command fails
341 void disableEvent(String sessionName
, String channelName
,
342 List
<String
> eventNames
, TraceDomainType domain
, IProgressMonitor monitor
)
343 throws ExecutionException
;
346 * Gets all available context names to be added to channels/events.
349 * The progress monitor
350 * @return the list of available contexts
351 * @throws ExecutionException
352 * If the command fails
354 @NonNull List
<String
> getContextList(IProgressMonitor monitor
)
355 throws ExecutionException
;
358 * Add contexts to given channels and or events
363 * - a channel name (null for all channels)
365 * - a event name (null for all events)
367 * - indicate the domain type ({@link TraceDomainType})
369 * - a list of name of contexts to add
371 * - a progress monitor
372 * @throws ExecutionException
373 * If the command fails
375 void addContexts(String sessionName
, String channelName
,
376 String eventName
, TraceDomainType domain
, List
<String
> contexts
,
377 IProgressMonitor monitor
) throws ExecutionException
;
380 * Records a snapshot.
385 * - a progress monitor
386 * @throws ExecutionException
387 * If the command fails
389 void recordSnapshot(String sessionName
, IProgressMonitor monitor
)
390 throws ExecutionException
;
393 * Executes a list of commands
396 * - a progress monitor
398 * - array of commands
399 * @throws ExecutionException
402 void runCommands(IProgressMonitor monitor
, List
<String
> commands
)
403 throws ExecutionException
;
406 * Load all or a given session.
409 * a input path to load session from or null for load all from default
411 * flag whether to overwrite existing or not
414 * @throws ExecutionException
415 * If the command fails
417 void loadSession(@Nullable String inputPath
, boolean isForce
, IProgressMonitor monitor
)
418 throws ExecutionException
;
421 * Save all or a given session.
424 * a session name to save or null for all
426 * a path to save session or null for default location
428 * flag whether to overwrite existing or not
431 * @throws ExecutionException
432 * If the command fails
434 void saveSession(@Nullable String session
, @Nullable String outputPath
, boolean isForce
, IProgressMonitor monitor
)
435 throws ExecutionException
;