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
.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
.tracecompass
.internal
.lttng2
.control
.core
.model
.IBaseEventInfo
;
20 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.IChannelInfo
;
21 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.ISessionInfo
;
22 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.ISnapshotInfo
;
23 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.IUstProviderInfo
;
24 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.LogLevelType
;
25 import org
.eclipse
.tracecompass
.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 LTTng version object
40 LttngVersion
getVersion();
43 * @return the version string
45 String
getVersionString();
48 * Checks if given version is supported by this ILTTngControlService implementation.
50 * @param version The version to check
51 * @return <code>true</code> if version is supported else <code>false</code>
53 boolean isVersionSupported(String version
);
56 * Retrieves the existing sessions names from the node.
59 * - a progress monitor
60 * @return an array with session names.
61 * @throws ExecutionException
62 * If the command fails
64 String
[] getSessionNames(IProgressMonitor monitor
)
65 throws ExecutionException
;
68 * Retrieves the session information with the given name the node.
73 * - a progress monitor
74 * @return session information
75 * @throws ExecutionException
76 * If the command fails
78 ISessionInfo
getSession(String sessionName
, IProgressMonitor monitor
)
79 throws ExecutionException
;
82 * Retrieves the snapshot output information from the node
86 * - a progress monitor
87 * @return snapshot output information
88 * @throws ExecutionException
91 ISnapshotInfo
getSnapshotInfo(String sessionName
, IProgressMonitor monitor
)
92 throws ExecutionException
;
95 * Retrieves the kernel provider information (i.e. the kernel events)
98 * - a progress monitor
99 * @return the list of existing kernel events.
100 * @throws ExecutionException
101 * If the command fails
103 List
<IBaseEventInfo
> getKernelProvider(IProgressMonitor monitor
)
104 throws ExecutionException
;
107 * Retrieves the UST provider information from the node.
109 * @return - the UST provider information.
110 * @throws ExecutionException
111 * If the command fails
113 public List
<IUstProviderInfo
> getUstProvider() throws ExecutionException
;
116 * Retrieves the UST provider information from the node.
119 * - a progress monitor
120 * @return the UST provider information.
121 * @throws ExecutionException
122 * If the command fails
124 List
<IUstProviderInfo
> getUstProvider(IProgressMonitor monitor
)
125 throws ExecutionException
;
128 * Creates a session with given session name and location.
131 * the session information used to create the session
133 * - a progress monitor
135 * @return the session information
136 * @throws ExecutionException
137 * If the command fails
139 ISessionInfo
createSession(ISessionInfo sessionInfo
, IProgressMonitor monitor
) throws ExecutionException
;
142 * Destroys a session with given session name.
145 * - a session name to destroy
147 * - a progress monitor
148 * @throws ExecutionException
149 * If the command fails
151 void destroySession(String sessionName
, IProgressMonitor monitor
)
152 throws ExecutionException
;
155 * Starts a session with given session name.
158 * - a session name to start
160 * - a progress monitor
161 * @throws ExecutionException
162 * If the command fails
164 void startSession(String sessionName
, IProgressMonitor monitor
)
165 throws ExecutionException
;
168 * Stops a session with given session name.
171 * - a session name to stop
173 * - a progress monitor
174 * @throws ExecutionException
175 * If the command fails
177 void stopSession(String sessionName
, IProgressMonitor monitor
)
178 throws ExecutionException
;
181 * Enables a list of channels for given session and given channel
182 * information (configuration).
185 * - a session name to create
186 * @param channelNames
187 * - a list of channel names to be enabled
189 * - a flag to indicate Kernel or UST (true for Kernel, false for
192 * - channel information used for creation of a channel (or null
195 * - a progress monitor
196 * @throws ExecutionException
197 * If the command fails
199 void enableChannels(String sessionName
, List
<String
> channelNames
,
200 boolean isKernel
, IChannelInfo info
, IProgressMonitor monitor
)
201 throws ExecutionException
;
204 * Disables a list of channels for given session and given channel
205 * information (configuration).
208 * - a session name to create
209 * @param channelNames
210 * - a list of channel names to be enabled
212 * - a flag to indicate Kernel or UST (true for Kernel, false for
215 * - a progress monitor
216 * @throws ExecutionException
217 * If the command fails
219 void disableChannels(String sessionName
, List
<String
> channelNames
,
220 boolean isKernel
, IProgressMonitor monitor
)
221 throws ExecutionException
;
224 * Enables a list of events with no additional parameters.
229 * - a channel name or null for default channel
231 * - a list of event names to be enabled, or null (list of size =
234 * - a flag for indicating kernel or UST.
235 * @param filterExpression
236 * - a filter expression
238 * - a progress monitor
239 * @throws ExecutionException
240 * If the command fails
242 void enableEvents(String sessionName
, String channelName
,
243 List
<String
> eventNames
, boolean isKernel
, String filterExpression
,
244 IProgressMonitor monitor
)
245 throws ExecutionException
;
249 * Enables all syscall events.
254 * - a channel name or null for default channel
256 * - a progress monitor
257 * @throws ExecutionException
258 * If the command fails
260 void enableSyscalls(String sessionName
, String channelName
,
261 IProgressMonitor monitor
) throws ExecutionException
;
264 * Enables a dynamic probe or dynamic function entry/return probe.
269 * - a channel name or null for default channel
273 * - true for dynamic function entry/return probe else false
275 * - a dynamic probe information
277 * - a progress monitor
278 * @throws ExecutionException
279 * If the command fails
281 void enableProbe(String sessionName
, String channelName
,
282 String eventName
, boolean isFunction
, String probe
,
283 IProgressMonitor monitor
) throws ExecutionException
;
286 * Enables events using log level
291 * - a channel name (null for default channel)
294 * @param logLevelType
298 * @param filterExpression
299 * - a filter expression
301 * - a progress monitor
302 * @throws ExecutionException
303 * If the command fails
305 void enableLogLevel(String sessionName
, String channelName
,
306 String eventName
, LogLevelType logLevelType
, TraceLogLevel level
,
307 String filterExpression
,
308 IProgressMonitor monitor
) throws ExecutionException
;
311 * Disables a list of events with no additional parameters.
316 * - a channel name (null for default channel)
318 * - a list of event names to enabled.
320 * - a flag for indicating kernel or UST.
322 * - a progress monitor
323 * @throws ExecutionException
324 * If the command fails
326 void disableEvent(String sessionName
, String channelName
,
327 List
<String
> eventNames
, boolean isKernel
, IProgressMonitor monitor
)
328 throws ExecutionException
;
331 * Gets all available context names to be added to channels/events.
334 * The progress monitor
335 * @return the list of available contexts
336 * @throws ExecutionException
337 * If the command fails
339 List
<String
> getContextList(IProgressMonitor monitor
)
340 throws ExecutionException
;
343 * Add contexts to given channels and or events
348 * - a channel name (null for all channels)
350 * - a event name (null for all events)
352 * - a flag for indicating kernel or UST.
354 * - a list of name of contexts to add
356 * - a progress monitor
357 * @throws ExecutionException
358 * If the command fails
360 void addContexts(String sessionName
, String channelName
,
361 String eventName
, boolean isKernel
, List
<String
> contexts
,
362 IProgressMonitor monitor
) throws ExecutionException
;
365 * Executes calibrate command to quantify LTTng overhead.
368 * - a flag for indicating kernel or UST.
370 * - a progress monitor
371 * @throws ExecutionException
372 * If the command fails
374 void calibrate(boolean isKernel
, IProgressMonitor monitor
)
375 throws ExecutionException
;
378 * Records a snapshot.
383 * - a progress monitor
384 * @throws ExecutionException
385 * If the command fails
387 void recordSnapshot(String sessionName
, IProgressMonitor monitor
)
388 throws ExecutionException
;
391 * Executes a list of commands
394 * - a progress monitor
396 * - array of commands
397 * @throws ExecutionException
400 void runCommands(IProgressMonitor monitor
, List
<String
> commands
)
401 throws ExecutionException
;