1 /**********************************************************************
2 * Copyright (c) 2012, 2013 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
.linuxtools
.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
.linuxtools
.internal
.lttng2
.control
.core
.model
.IBaseEventInfo
;
20 import org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.IChannelInfo
;
21 import org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.ISessionInfo
;
22 import org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.ISnapshotInfo
;
23 import org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.IUstProviderInfo
;
24 import org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.LogLevelType
;
25 import org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.TraceLogLevel
;
30 * Interface for LTTng trace control command service.
33 * @author Bernd Hufmann
35 public interface ILttngControlService
{
38 * @return the version string.
43 * Checks if given version is supported by this ILTTngControlService implementation.
45 * @param version The version to check
46 * @return <code>true</code> if version is supported else <code>false</code>
48 boolean isVersionSupported(String version
);
51 * Retrieves the existing sessions names from the node.
54 * - a progress monitor
55 * @return an array with session names.
56 * @throws ExecutionException
57 * If the command fails
59 String
[] getSessionNames(IProgressMonitor monitor
)
60 throws ExecutionException
;
63 * Retrieves the session information with the given name the node.
68 * - a progress monitor
69 * @return session information
70 * @throws ExecutionException
71 * If the command fails
73 ISessionInfo
getSession(String sessionName
, IProgressMonitor monitor
)
74 throws ExecutionException
;
77 * Retrieves the snapshot output information from the node
81 * - a progress monitor
82 * @return snapshot output information
83 * @throws ExecutionException
86 ISnapshotInfo
getSnapshotInfo(String sessionName
, IProgressMonitor monitor
)
87 throws ExecutionException
;
90 * Retrieves the kernel provider information (i.e. the kernel events)
93 * - a progress monitor
94 * @return the list of existing kernel events.
95 * @throws ExecutionException
96 * If the command fails
98 List
<IBaseEventInfo
> getKernelProvider(IProgressMonitor monitor
)
99 throws ExecutionException
;
102 * Retrieves the UST provider information from the node.
104 * @return - the UST provider information.
105 * @throws ExecutionException
106 * If the command fails
108 public List
<IUstProviderInfo
> getUstProvider() throws ExecutionException
;
111 * Retrieves the UST provider information from the node.
114 * - a progress monitor
115 * @return the UST provider information.
116 * @throws ExecutionException
117 * If the command fails
119 List
<IUstProviderInfo
> getUstProvider(IProgressMonitor monitor
)
120 throws ExecutionException
;
123 * Creates a session with given session name and location.
126 * the session information used to create the session
128 * - a progress monitor
130 * @return the session information
131 * @throws ExecutionException
132 * If the command fails
134 ISessionInfo
createSession(ISessionInfo sessionInfo
, IProgressMonitor monitor
) throws ExecutionException
;
137 * Destroys a session with given session name.
140 * - a session name to destroy
142 * - a progress monitor
143 * @throws ExecutionException
144 * If the command fails
146 void destroySession(String sessionName
, IProgressMonitor monitor
)
147 throws ExecutionException
;
150 * Starts a session with given session name.
153 * - a session name to start
155 * - a progress monitor
156 * @throws ExecutionException
157 * If the command fails
159 void startSession(String sessionName
, IProgressMonitor monitor
)
160 throws ExecutionException
;
163 * Stops a session with given session name.
166 * - a session name to stop
168 * - a progress monitor
169 * @throws ExecutionException
170 * If the command fails
172 void stopSession(String sessionName
, IProgressMonitor monitor
)
173 throws ExecutionException
;
176 * Enables a list of channels for given session and given channel
177 * information (configuration).
180 * - a session name to create
181 * @param channelNames
182 * - a list of channel names to be enabled
184 * - a flag to indicate Kernel or UST (true for Kernel, false for
187 * - channel information used for creation of a channel (or null
190 * - a progress monitor
191 * @throws ExecutionException
192 * If the command fails
194 void enableChannels(String sessionName
, List
<String
> channelNames
,
195 boolean isKernel
, IChannelInfo info
, IProgressMonitor monitor
)
196 throws ExecutionException
;
199 * Disables a list of channels for given session and given channel
200 * information (configuration).
203 * - a session name to create
204 * @param channelNames
205 * - a list of channel names to be enabled
207 * - a flag to indicate Kernel or UST (true for Kernel, false for
210 * - a progress monitor
211 * @throws ExecutionException
212 * If the command fails
214 void disableChannels(String sessionName
, List
<String
> channelNames
,
215 boolean isKernel
, IProgressMonitor monitor
)
216 throws ExecutionException
;
219 * Enables a list of events with no additional parameters.
224 * - a channel name or null for default channel
226 * - a list of event names to be enabled, or null (list of size =
229 * - a flag for indicating kernel or UST.
230 * @param filterExpression
231 * - a filter expression
233 * - a progress monitor
234 * @throws ExecutionException
235 * If the command fails
237 void enableEvents(String sessionName
, String channelName
,
238 List
<String
> eventNames
, boolean isKernel
, String filterExpression
,
239 IProgressMonitor monitor
)
240 throws ExecutionException
;
244 * Enables all syscall events.
249 * - a channel name or null for default channel
251 * - a progress monitor
252 * @throws ExecutionException
253 * If the command fails
255 void enableSyscalls(String sessionName
, String channelName
,
256 IProgressMonitor monitor
) throws ExecutionException
;
259 * Enables a dynamic probe or dynamic function entry/return probe.
264 * - a channel name or null for default channel
268 * - true for dynamic function entry/return probe else false
270 * - a dynamic probe information
272 * - a progress monitor
273 * @throws ExecutionException
274 * If the command fails
276 void enableProbe(String sessionName
, String channelName
,
277 String eventName
, boolean isFunction
, String probe
,
278 IProgressMonitor monitor
) throws ExecutionException
;
281 * Enables events using log level
286 * - a channel name (null for default channel)
289 * @param logLevelType
293 * @param filterExpression
294 * - a filter expression
296 * - a progress monitor
297 * @throws ExecutionException
298 * If the command fails
300 void enableLogLevel(String sessionName
, String channelName
,
301 String eventName
, LogLevelType logLevelType
, TraceLogLevel level
,
302 String filterExpression
,
303 IProgressMonitor monitor
) throws ExecutionException
;
306 * Disables a list of events with no additional parameters.
311 * - a channel name (null for default channel)
313 * - a list of event names to enabled.
315 * - a flag for indicating kernel or UST.
317 * - a progress monitor
318 * @throws ExecutionException
319 * If the command fails
321 void disableEvent(String sessionName
, String channelName
,
322 List
<String
> eventNames
, boolean isKernel
, IProgressMonitor monitor
)
323 throws ExecutionException
;
326 * Gets all available context names to be added to channels/events.
329 * The progress monitor
330 * @return the list of available contexts
331 * @throws ExecutionException
332 * If the command fails
334 List
<String
> getContextList(IProgressMonitor monitor
)
335 throws ExecutionException
;
338 * Add contexts to given channels and or events
343 * - a channel name (null for all channels)
345 * - a event name (null for all events)
347 * - a flag for indicating kernel or UST.
349 * - a list of name of contexts to add
351 * - a progress monitor
352 * @throws ExecutionException
353 * If the command fails
355 void addContexts(String sessionName
, String channelName
,
356 String eventName
, boolean isKernel
, List
<String
> contexts
,
357 IProgressMonitor monitor
) throws ExecutionException
;
360 * Executes calibrate command to quantify LTTng overhead.
363 * - a flag for indicating kernel or UST.
365 * - a progress monitor
366 * @throws ExecutionException
367 * If the command fails
369 void calibrate(boolean isKernel
, IProgressMonitor monitor
)
370 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
;