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
, IProgressMonitor monitor
) throws ExecutionException
;
124 * Creates a session with given session name and location.
127 * - a session name to create
129 * - a network URL for common definition of data and control channel
130 * or null if separate definition of data and control channel
132 * - a URL for control channel (networkUrl has to be null, dataUrl has to be set)
134 * - a URL for data channel (networkUrl has to be null, controlUrl has to be set)
136 * - a progress monitor
137 * @return the session information
138 * @throws ExecutionException
139 * If the command fails
141 public ISessionInfo
createSession(String sessionName
, String networkUrl
, String controlUrl
, String dataUrl
, IProgressMonitor monitor
) throws ExecutionException
;
144 * Destroys a session with given session name.
147 * - a session name to destroy
149 * - a progress monitor
150 * @throws ExecutionException
151 * If the command fails
153 public void destroySession(String sessionName
, IProgressMonitor monitor
)
154 throws ExecutionException
;
157 * Starts a session with given session name.
160 * - a session name to start
162 * - a progress monitor
163 * @throws ExecutionException
164 * If the command fails
166 public void startSession(String sessionName
, IProgressMonitor monitor
)
167 throws ExecutionException
;
170 * Stops a session with given session name.
173 * - a session name to stop
175 * - a progress monitor
176 * @throws ExecutionException
177 * If the command fails
179 public void stopSession(String sessionName
, IProgressMonitor monitor
)
180 throws ExecutionException
;
183 * Enables a list of channels for given session and given channel
184 * information (configuration).
187 * - a session name to create
188 * @param channelNames
189 * - a list of channel names to be enabled
191 * - a flag to indicate Kernel or UST (true for Kernel, false for
194 * - channel information used for creation of a channel (or null
197 * - a progress monitor
198 * @throws ExecutionException
199 * If the command fails
201 public void enableChannels(String sessionName
, List
<String
> channelNames
,
202 boolean isKernel
, IChannelInfo info
, IProgressMonitor monitor
)
203 throws ExecutionException
;
206 * Disables a list of channels for given session and given channel
207 * information (configuration).
210 * - a session name to create
211 * @param channelNames
212 * - a list of channel names to be enabled
214 * - a flag to indicate Kernel or UST (true for Kernel, false for
217 * - a progress monitor
218 * @throws ExecutionException
219 * If the command fails
221 public void disableChannels(String sessionName
, List
<String
> channelNames
,
222 boolean isKernel
, IProgressMonitor monitor
)
223 throws ExecutionException
;
226 * Enables a list of events with no additional parameters.
231 * - a channel name or null for default channel
233 * - a list of event names to be enabled, or null (list of size =
236 * - a flag for indicating kernel or UST.
237 * @param filterExpression
238 * - a filter expression
240 * - a progress monitor
241 * @throws ExecutionException
242 * If the command fails
244 public void enableEvents(String sessionName
, String channelName
,
245 List
<String
> eventNames
, boolean isKernel
, String filterExpression
,
246 IProgressMonitor monitor
)
247 throws ExecutionException
;
251 * Enables all syscall events.
256 * - a channel name or null for default channel
258 * - a progress monitor
259 * @throws ExecutionException
260 * If the command fails
262 public void enableSyscalls(String sessionName
, String channelName
,
263 IProgressMonitor monitor
) throws ExecutionException
;
266 * Enables a dynamic probe or dynamic function entry/return probe.
271 * - a channel name or null for default channel
275 * - true for dynamic function entry/return probe else false
277 * - a dynamic probe information
279 * - a progress monitor
280 * @throws ExecutionException
281 * If the command fails
283 public void enableProbe(String sessionName
, String channelName
,
284 String eventName
, boolean isFunction
, String probe
,
285 IProgressMonitor monitor
) throws ExecutionException
;
288 * Enables events using log level
293 * - a channel name (null for default channel)
296 * @param logLevelType
300 * @param filterExpression
301 * - a filter expression
303 * - a progress monitor
304 * @throws ExecutionException
305 * If the command fails
307 public void enableLogLevel(String sessionName
, String channelName
,
308 String eventName
, LogLevelType logLevelType
, TraceLogLevel level
,
309 String filterExpression
,
310 IProgressMonitor monitor
) throws ExecutionException
;
313 * Disables a list of events with no additional parameters.
318 * - a channel name (null for default channel)
320 * - a list of event names to enabled.
322 * - a flag for indicating kernel or UST.
324 * - a progress monitor
325 * @throws ExecutionException
326 * If the command fails
328 public void disableEvent(String sessionName
, String channelName
,
329 List
<String
> eventNames
, boolean isKernel
, IProgressMonitor monitor
)
330 throws ExecutionException
;
333 * Gets all available context names to be added to channels/events.
336 * The progress monitor
337 * @return the list of available contexts
338 * @throws ExecutionException
339 * If the command fails
341 public List
<String
> getContextList(IProgressMonitor monitor
)
342 throws ExecutionException
;
345 * Add contexts to given channels and or events
350 * - a channel name (null for all channels)
352 * - a event name (null for all events)
354 * - a flag for indicating kernel or UST.
356 * - a list of name of contexts to add
358 * - a progress monitor
359 * @throws ExecutionException
360 * If the command fails
362 public void addContexts(String sessionName
, String channelName
,
363 String eventName
, boolean isKernel
, List
<String
> contexts
,
364 IProgressMonitor monitor
) throws ExecutionException
;
367 * Executes calibrate command to quantify LTTng overhead.
370 * - a flag for indicating kernel or UST.
372 * - a progress monitor
373 * @throws ExecutionException
374 * If the command fails
376 public void calibrate(boolean isKernel
, IProgressMonitor monitor
)
377 throws ExecutionException
;