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
.ui
.views
.control
.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
.core
.control
.model
.IBaseEventInfo
;
20 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.IChannelInfo
;
21 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.ISessionInfo
;
22 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.ISnapshotInfo
;
23 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.IUstProviderInfo
;
24 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.LogLevelType
;
25 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.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 * - a session name to create
128 * - a path for storing the traces (use null for default)
130 * - true for snapshot session else false
132 * - a progress monitor
133 * @return the session information
134 * @throws ExecutionException
135 * If the command fails
137 ISessionInfo
createSession(String sessionName
, String sessionPath
, boolean isSnapshot
, IProgressMonitor monitor
) throws ExecutionException
;
140 * Creates a session with given session name and location.
143 * - a session name to create
145 * - a network URL for common definition of data and control channel
146 * or null if separate definition of data and control channel
148 * - a URL for control channel (networkUrl has to be null, dataUrl has to be set)
150 * - a URL for data channel (networkUrl has to be null, controlUrl has to be set)
152 * - true for snapshot session else false
154 * - a progress monitor
155 * @return the session information
156 * @throws ExecutionException
157 * If the command fails
159 ISessionInfo
createSession(String sessionName
, String networkUrl
, String controlUrl
, String dataUrl
, boolean isSnapshot
, IProgressMonitor monitor
) throws ExecutionException
;
162 * Destroys a session with given session name.
165 * - a session name to destroy
167 * - a progress monitor
168 * @throws ExecutionException
169 * If the command fails
171 void destroySession(String sessionName
, IProgressMonitor monitor
)
172 throws ExecutionException
;
175 * Starts a session with given session name.
178 * - a session name to start
180 * - a progress monitor
181 * @throws ExecutionException
182 * If the command fails
184 void startSession(String sessionName
, IProgressMonitor monitor
)
185 throws ExecutionException
;
188 * Stops a session with given session name.
191 * - a session name to stop
193 * - a progress monitor
194 * @throws ExecutionException
195 * If the command fails
197 void stopSession(String sessionName
, IProgressMonitor monitor
)
198 throws ExecutionException
;
201 * Enables a list of channels for given session and given channel
202 * information (configuration).
205 * - a session name to create
206 * @param channelNames
207 * - a list of channel names to be enabled
209 * - a flag to indicate Kernel or UST (true for Kernel, false for
212 * - channel information used for creation of a channel (or null
215 * - a progress monitor
216 * @throws ExecutionException
217 * If the command fails
219 void enableChannels(String sessionName
, List
<String
> channelNames
,
220 boolean isKernel
, IChannelInfo info
, IProgressMonitor monitor
)
221 throws ExecutionException
;
224 * Disables a list of channels for given session and given channel
225 * information (configuration).
228 * - a session name to create
229 * @param channelNames
230 * - a list of channel names to be enabled
232 * - a flag to indicate Kernel or UST (true for Kernel, false for
235 * - a progress monitor
236 * @throws ExecutionException
237 * If the command fails
239 void disableChannels(String sessionName
, List
<String
> channelNames
,
240 boolean isKernel
, IProgressMonitor monitor
)
241 throws ExecutionException
;
244 * Enables a list of events with no additional parameters.
249 * - a channel name or null for default channel
251 * - a list of event names to be enabled, or null (list of size =
254 * - a flag for indicating kernel or UST.
255 * @param filterExpression
256 * - a filter expression
258 * - a progress monitor
259 * @throws ExecutionException
260 * If the command fails
262 void enableEvents(String sessionName
, String channelName
,
263 List
<String
> eventNames
, boolean isKernel
, String filterExpression
,
264 IProgressMonitor monitor
)
265 throws ExecutionException
;
269 * Enables all syscall events.
274 * - a channel name or null for default channel
276 * - a progress monitor
277 * @throws ExecutionException
278 * If the command fails
280 void enableSyscalls(String sessionName
, String channelName
,
281 IProgressMonitor monitor
) throws ExecutionException
;
284 * Enables a dynamic probe or dynamic function entry/return probe.
289 * - a channel name or null for default channel
293 * - true for dynamic function entry/return probe else false
295 * - a dynamic probe information
297 * - a progress monitor
298 * @throws ExecutionException
299 * If the command fails
301 void enableProbe(String sessionName
, String channelName
,
302 String eventName
, boolean isFunction
, String probe
,
303 IProgressMonitor monitor
) throws ExecutionException
;
306 * Enables events using log level
311 * - a channel name (null for default channel)
314 * @param logLevelType
318 * @param filterExpression
319 * - a filter expression
321 * - a progress monitor
322 * @throws ExecutionException
323 * If the command fails
325 void enableLogLevel(String sessionName
, String channelName
,
326 String eventName
, LogLevelType logLevelType
, TraceLogLevel level
,
327 String filterExpression
,
328 IProgressMonitor monitor
) throws ExecutionException
;
331 * Disables a list of events with no additional parameters.
336 * - a channel name (null for default channel)
338 * - a list of event names to enabled.
340 * - a flag for indicating kernel or UST.
342 * - a progress monitor
343 * @throws ExecutionException
344 * If the command fails
346 void disableEvent(String sessionName
, String channelName
,
347 List
<String
> eventNames
, boolean isKernel
, IProgressMonitor monitor
)
348 throws ExecutionException
;
351 * Gets all available context names to be added to channels/events.
354 * The progress monitor
355 * @return the list of available contexts
356 * @throws ExecutionException
357 * If the command fails
359 List
<String
> getContextList(IProgressMonitor monitor
)
360 throws ExecutionException
;
363 * Add contexts to given channels and or events
368 * - a channel name (null for all channels)
370 * - a event name (null for all events)
372 * - a flag for indicating kernel or UST.
374 * - a list of name of contexts to add
376 * - a progress monitor
377 * @throws ExecutionException
378 * If the command fails
380 void addContexts(String sessionName
, String channelName
,
381 String eventName
, boolean isKernel
, List
<String
> contexts
,
382 IProgressMonitor monitor
) throws ExecutionException
;
385 * Executes calibrate command to quantify LTTng overhead.
388 * - a flag for indicating kernel or UST.
390 * - a progress monitor
391 * @throws ExecutionException
392 * If the command fails
394 void calibrate(boolean isKernel
, IProgressMonitor monitor
)
395 throws ExecutionException
;
398 * Records a snapshot.
403 * - a progress monitor
404 * @throws ExecutionException
405 * If the command fails
407 void recordSnapshot(String sessionName
, IProgressMonitor monitor
)
408 throws ExecutionException
;