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
.IUstProviderInfo
;
23 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.LogLevelType
;
24 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.TraceLogLevel
;
29 * Interface for LTTng trace control command service.
32 * @author Bernd Hufmann
34 public interface ILttngControlService
{
37 * @return the version string.
39 public String
getVersion();
42 * Checks if given version is supported by this ILTTngControlService implementation.
44 * @param version The version to check
45 * @return <code>true</code> if version is supported else <code>false</code>
47 public boolean isVersionSupported(String version
);
50 * Retrieves the existing sessions names from the node.
53 * - a progress monitor
54 * @return an array with session names.
55 * @throws ExecutionException
56 * If the command fails
58 public String
[] getSessionNames(IProgressMonitor monitor
)
59 throws ExecutionException
;
62 * Retrieves the session information with the given name the node.
67 * - a progress monitor
68 * @return session information
69 * @throws ExecutionException
70 * If the command fails
72 public ISessionInfo
getSession(String sessionName
, IProgressMonitor monitor
)
73 throws ExecutionException
;
76 * Retrieves the kernel provider information (i.e. the kernel events)
79 * - a progress monitor
80 * @return the list of existing kernel events.
81 * @throws ExecutionException
82 * If the command fails
84 public List
<IBaseEventInfo
> getKernelProvider(IProgressMonitor monitor
)
85 throws ExecutionException
;
88 * Retrieves the UST provider information from the node.
90 * @return - the UST provider information.
91 * @throws ExecutionException
92 * If the command fails
94 public List
<IUstProviderInfo
> getUstProvider() throws ExecutionException
;
97 * Retrieves the UST provider information from the node.
100 * - a progress monitor
101 * @return the UST provider information.
102 * @throws ExecutionException
103 * If the command fails
105 public List
<IUstProviderInfo
> getUstProvider(IProgressMonitor monitor
)
106 throws ExecutionException
;
109 * Creates a session with given session name and location.
112 * - a session name to create
114 * - a path for storing the traces (use null for default)
116 * - a progress monitor
117 * @return the session information
118 * @throws ExecutionException
119 * If the command fails
121 public ISessionInfo
createSession(String sessionName
, String sessionPath
,
122 IProgressMonitor monitor
) throws ExecutionException
;
125 * Creates a session with given session name and location.
128 * - a session name to create
130 * - a path for storing the traces (use null for default)
132 * - a flag to indicate no consumer
133 * @param disableConsumer
134 * - a flag to disable consumer
136 * - a progress monitor
137 * @return the session information
138 * @throws ExecutionException
139 * If the command fails
141 public ISessionInfo
createSession(String sessionName
, String sessionPath
, boolean noConsumer
, boolean disableConsumer
,
142 IProgressMonitor monitor
) throws ExecutionException
;
146 * Creates a session with given session name and location.
149 * - a session name to create
151 * - a network URL for common definition of data and control channel
152 * or null if separate definition of data and control channel
154 * - a URL for control channel (networkUrl has to be null, dataUrl has to be set)
156 * - a URL for data channel (networkUrl has to be null, controlUrl has to be set)
158 * - a flag to indicate no consumer
159 * @param disableConsumer
160 * - a flag to disable consumer
162 * - a progress monitor
163 * @return the session information
164 * @throws ExecutionException
165 * If the command fails
167 public ISessionInfo
createSession(String sessionName
, String networkUrl
, String controlUrl
, String dataUrl
, boolean noConsumer
, boolean disableConsumer
,
168 IProgressMonitor monitor
) throws ExecutionException
;
171 * Destroys a session with given session name.
174 * - a session name to destroy
176 * - a progress monitor
177 * @throws ExecutionException
178 * If the command fails
180 public void destroySession(String sessionName
, IProgressMonitor monitor
)
181 throws ExecutionException
;
184 * Starts a session with given session name.
187 * - a session name to start
189 * - a progress monitor
190 * @throws ExecutionException
191 * If the command fails
193 public void startSession(String sessionName
, IProgressMonitor monitor
)
194 throws ExecutionException
;
197 * Stops a session with given session name.
200 * - a session name to stop
202 * - a progress monitor
203 * @throws ExecutionException
204 * If the command fails
206 public void stopSession(String sessionName
, IProgressMonitor monitor
)
207 throws ExecutionException
;
210 * Enables a list of channels for given session and given channel
211 * information (configuration).
214 * - a session name to create
215 * @param channelNames
216 * - a list of channel names to be enabled
218 * - a flag to indicate Kernel or UST (true for Kernel, false for
221 * - channel information used for creation of a channel (or null
224 * - a progress monitor
225 * @throws ExecutionException
226 * If the command fails
228 public void enableChannels(String sessionName
, List
<String
> channelNames
,
229 boolean isKernel
, IChannelInfo info
, IProgressMonitor monitor
)
230 throws ExecutionException
;
233 * Disables a list of channels for given session and given channel
234 * information (configuration).
237 * - a session name to create
238 * @param channelNames
239 * - a list of channel names to be enabled
241 * - a flag to indicate Kernel or UST (true for Kernel, false for
244 * - a progress monitor
245 * @throws ExecutionException
246 * If the command fails
248 public void disableChannels(String sessionName
, List
<String
> channelNames
,
249 boolean isKernel
, IProgressMonitor monitor
)
250 throws ExecutionException
;
253 * Enables a list of events with no additional parameters.
258 * - a channel name or null for default channel
260 * - a list of event names to be enabled, or null (list of size =
263 * - a flag for indicating kernel or UST.
264 * @param filterExpression
265 * - a filter expression
267 * - a progress monitor
268 * @throws ExecutionException
269 * If the command fails
271 public void enableEvents(String sessionName
, String channelName
,
272 List
<String
> eventNames
, boolean isKernel
, String filterExpression
,
273 IProgressMonitor monitor
)
274 throws ExecutionException
;
278 * Enables all syscall events.
283 * - a channel name or null for default channel
285 * - a progress monitor
286 * @throws ExecutionException
287 * If the command fails
289 public void enableSyscalls(String sessionName
, String channelName
,
290 IProgressMonitor monitor
) throws ExecutionException
;
293 * Enables a dynamic probe or dynamic function entry/return probe.
298 * - a channel name or null for default channel
302 * - true for dynamic function entry/return probe else false
304 * - a dynamic probe information
306 * - a progress monitor
307 * @throws ExecutionException
308 * If the command fails
310 public void enableProbe(String sessionName
, String channelName
,
311 String eventName
, boolean isFunction
, String probe
,
312 IProgressMonitor monitor
) throws ExecutionException
;
315 * Enables events using log level
320 * - a channel name (null for default channel)
323 * @param logLevelType
327 * @param filterExpression
328 * - a filter expression
330 * - a progress monitor
331 * @throws ExecutionException
332 * If the command fails
334 public void enableLogLevel(String sessionName
, String channelName
,
335 String eventName
, LogLevelType logLevelType
, TraceLogLevel level
,
336 String filterExpression
,
337 IProgressMonitor monitor
) throws ExecutionException
;
340 * Disables a list of events with no additional parameters.
345 * - a channel name (null for default channel)
347 * - a list of event names to enabled.
349 * - a flag for indicating kernel or UST.
351 * - a progress monitor
352 * @throws ExecutionException
353 * If the command fails
355 public void disableEvent(String sessionName
, String channelName
,
356 List
<String
> eventNames
, boolean isKernel
, IProgressMonitor monitor
)
357 throws ExecutionException
;
360 * Gets all available context names to be added to channels/events.
363 * The progress monitor
364 * @return the list of available contexts
365 * @throws ExecutionException
366 * If the command fails
368 public List
<String
> getContextList(IProgressMonitor monitor
)
369 throws ExecutionException
;
372 * Add contexts to given channels and or events
377 * - a channel name (null for all channels)
379 * - a event name (null for all events)
381 * - a flag for indicating kernel or UST.
383 * - a list of name of contexts to add
385 * - a progress monitor
386 * @throws ExecutionException
387 * If the command fails
389 public void addContexts(String sessionName
, String channelName
,
390 String eventName
, boolean isKernel
, List
<String
> contexts
,
391 IProgressMonitor monitor
) throws ExecutionException
;
394 * Executes calibrate command to quantify LTTng overhead.
397 * - a flag for indicating kernel or UST.
399 * - a progress monitor
400 * @throws ExecutionException
401 * If the command fails
403 public void calibrate(boolean isKernel
, IProgressMonitor monitor
)
404 throws ExecutionException
;