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
.List
;
17 import org
.eclipse
.core
.commands
.ExecutionException
;
18 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
19 import org
.eclipse
.jdt
.annotation
.NonNull
;
20 import org
.eclipse
.jdt
.annotation
.Nullable
;
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
;
32 * Interface for LTTng trace control command service.
35 * @author Bernd Hufmann
37 public interface ILttngControlService
{
40 * @return the LTTng version object
42 @NonNull LttngVersion
getVersion();
45 * @return the version string
47 @NonNull String
getVersionString();
50 * Checks if given version is supported by this ILTTngControlService implementation.
52 * @param version The version to check
53 * @return <code>true</code> if version is supported else <code>false</code>
55 boolean isVersionSupported(String version
);
58 * Retrieves the existing sessions names from the node.
61 * - a progress monitor
62 * @return a list of session names.
63 * @throws ExecutionException
64 * If the command fails
66 @NonNull List
<String
> getSessionNames(IProgressMonitor monitor
) throws ExecutionException
;
69 * Retrieves the session information with the given name the node.
74 * - a progress monitor
75 * @return session information
76 * @throws ExecutionException
77 * If the command fails
79 @Nullable ISessionInfo
getSession(String sessionName
, IProgressMonitor monitor
)
80 throws ExecutionException
;
83 * Retrieves the snapshot output information from the node
87 * - a progress monitor
88 * @return snapshot output information
89 * @throws ExecutionException
92 @Nullable ISnapshotInfo
getSnapshotInfo(String sessionName
, IProgressMonitor monitor
)
93 throws ExecutionException
;
96 * Retrieves the kernel provider information (i.e. the kernel events)
99 * - a progress monitor
100 * @return the list of existing kernel events.
101 * @throws ExecutionException
102 * If the command fails
104 @NonNull List
<IBaseEventInfo
> getKernelProvider(IProgressMonitor monitor
)
105 throws ExecutionException
;
108 * Retrieves the UST provider information from the node.
110 * @return - the UST provider information.
111 * @throws ExecutionException
112 * If the command fails
114 @NonNull public List
<IUstProviderInfo
> getUstProvider() throws ExecutionException
;
117 * Retrieves the UST provider information from the node.
120 * - a progress monitor
121 * @return the UST provider information.
122 * @throws ExecutionException
123 * If the command fails
125 @NonNull List
<IUstProviderInfo
> getUstProvider(IProgressMonitor monitor
)
126 throws ExecutionException
;
129 * Creates a session with given session name and location.
132 * the session information used to create the session
134 * - a progress monitor
136 * @return the session information
137 * @throws ExecutionException
138 * If the command fails
140 @Nullable ISessionInfo
createSession(ISessionInfo sessionInfo
, IProgressMonitor monitor
) throws ExecutionException
;
143 * Destroys a session with given session name.
146 * - a session name to destroy
148 * - a progress monitor
149 * @throws ExecutionException
150 * If the command fails
152 void destroySession(String sessionName
, IProgressMonitor monitor
)
153 throws ExecutionException
;
156 * Starts a session with given session name.
159 * - a session name to start
161 * - a progress monitor
162 * @throws ExecutionException
163 * If the command fails
165 void startSession(String sessionName
, IProgressMonitor monitor
)
166 throws ExecutionException
;
169 * Stops a session with given session name.
172 * - a session name to stop
174 * - a progress monitor
175 * @throws ExecutionException
176 * If the command fails
178 void stopSession(String sessionName
, IProgressMonitor monitor
)
179 throws ExecutionException
;
182 * Enables a list of channels for given session and given channel
183 * information (configuration).
186 * - a session name to create
187 * @param channelNames
188 * - a list of channel names to be enabled
190 * - a flag to indicate Kernel or UST (true for Kernel, false for
193 * - channel information used for creation of a channel (or null
196 * - a progress monitor
197 * @throws ExecutionException
198 * If the command fails
200 void enableChannels(String sessionName
, List
<String
> channelNames
,
201 boolean isKernel
, IChannelInfo info
, IProgressMonitor monitor
)
202 throws ExecutionException
;
205 * Disables a list of channels for given session and given channel
206 * information (configuration).
209 * - a session name to create
210 * @param channelNames
211 * - a list of channel names to be enabled
213 * - a flag to indicate Kernel or UST (true for Kernel, false for
216 * - a progress monitor
217 * @throws ExecutionException
218 * If the command fails
220 void disableChannels(String sessionName
, List
<String
> channelNames
,
221 boolean isKernel
, IProgressMonitor monitor
)
222 throws ExecutionException
;
225 * Enables a list of events with no additional parameters.
230 * - a channel name or null for default channel
232 * - a list of event names to be enabled, or null (list of size =
235 * - a flag for indicating kernel or UST.
236 * @param filterExpression
237 * - a filter expression
239 * - a progress monitor
240 * @throws ExecutionException
241 * If the command fails
243 void enableEvents(String sessionName
, String channelName
,
244 List
<String
> eventNames
, boolean isKernel
, String filterExpression
,
245 IProgressMonitor monitor
)
246 throws ExecutionException
;
250 * Enables all syscall events.
255 * - a channel name or null for default channel
257 * - a progress monitor
258 * @throws ExecutionException
259 * If the command fails
261 void enableSyscalls(String sessionName
, String channelName
,
262 IProgressMonitor monitor
) throws ExecutionException
;
265 * Enables a dynamic probe or dynamic function entry/return probe.
270 * - a channel name or null for default channel
274 * - true for dynamic function entry/return probe else false
276 * - a dynamic probe information
278 * - a progress monitor
279 * @throws ExecutionException
280 * If the command fails
282 void enableProbe(String sessionName
, String channelName
,
283 String eventName
, boolean isFunction
, String probe
,
284 IProgressMonitor monitor
) throws ExecutionException
;
287 * Enables events using log level
292 * - a channel name (null for default channel)
295 * @param logLevelType
299 * @param filterExpression
300 * - a filter expression
302 * - a progress monitor
303 * @throws ExecutionException
304 * If the command fails
306 void enableLogLevel(String sessionName
, String channelName
,
307 String eventName
, LogLevelType logLevelType
, TraceLogLevel level
,
308 String filterExpression
,
309 IProgressMonitor monitor
) throws ExecutionException
;
312 * Disables a list of events with no additional parameters.
317 * - a channel name (null for default channel)
319 * - a list of event names to enabled.
321 * - a flag for indicating kernel or UST.
323 * - a progress monitor
324 * @throws ExecutionException
325 * If the command fails
327 void disableEvent(String sessionName
, String channelName
,
328 List
<String
> eventNames
, boolean isKernel
, IProgressMonitor monitor
)
329 throws ExecutionException
;
332 * Gets all available context names to be added to channels/events.
335 * The progress monitor
336 * @return the list of available contexts
337 * @throws ExecutionException
338 * If the command fails
340 @NonNull List
<String
> getContextList(IProgressMonitor monitor
)
341 throws ExecutionException
;
344 * Add contexts to given channels and or events
349 * - a channel name (null for all channels)
351 * - a event name (null for all events)
353 * - a flag for indicating kernel or UST.
355 * - a list of name of contexts to add
357 * - a progress monitor
358 * @throws ExecutionException
359 * If the command fails
361 void addContexts(String sessionName
, String channelName
,
362 String eventName
, boolean isKernel
, List
<String
> contexts
,
363 IProgressMonitor monitor
) throws ExecutionException
;
366 * Executes calibrate command to quantify LTTng overhead.
369 * - a flag for indicating kernel or UST.
371 * - a progress monitor
372 * @throws ExecutionException
373 * If the command fails
375 void calibrate(boolean isKernel
, IProgressMonitor monitor
)
376 throws ExecutionException
;
379 * Records a snapshot.
384 * - a progress monitor
385 * @throws ExecutionException
386 * If the command fails
388 void recordSnapshot(String sessionName
, IProgressMonitor monitor
)
389 throws ExecutionException
;
392 * Executes a list of commands
395 * - a progress monitor
397 * - array of commands
398 * @throws ExecutionException
401 void runCommands(IProgressMonitor monitor
, List
<String
> commands
)
402 throws ExecutionException
;
405 * Load a session with given session name.
408 * - a session name to start
410 * - a progress monitor
411 * @throws ExecutionException
412 * If the command fails
414 void loadSession(String sessionName
, IProgressMonitor monitor
)
415 throws ExecutionException
;