1 /**********************************************************************
2 * Copyright (c) 2012 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 **********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.service
;
14 import java
.util
.List
;
16 import org
.eclipse
.core
.commands
.ExecutionException
;
17 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
18 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.IBaseEventInfo
;
19 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.IChannelInfo
;
20 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.ISessionInfo
;
21 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.IUstProviderInfo
;
22 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.LogLevelType
;
23 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.TraceLogLevel
;
28 * Interface for LTTng trace control command service.
31 * @author Bernd Hufmann
33 public interface ILttngControlService
{
36 * @return the version string.
38 public String
getVersion();
41 * Checks if given version is supported by this ILTTngControlService implementation.
43 * @param version The version to check
44 * @return <code>true</code> if version is supported else <code>false</code>
46 public boolean isVersionSupported(String version
);
49 * Retrieves the existing sessions names from the node.
52 * - a progress monitor
53 * @return an array with session names.
54 * @throws ExecutionException
55 * If the command fails
57 public String
[] getSessionNames(IProgressMonitor monitor
)
58 throws ExecutionException
;
61 * Retrieves the session information with the given name the node.
66 * - a progress monitor
67 * @return session information
68 * @throws ExecutionException
69 * If the command fails
71 public ISessionInfo
getSession(String sessionName
, IProgressMonitor monitor
)
72 throws ExecutionException
;
75 * Retrieves the kernel provider information (i.e. the kernel events)
78 * - a progress monitor
79 * @return the list of existing kernel events.
80 * @throws ExecutionException
81 * If the command fails
83 public List
<IBaseEventInfo
> getKernelProvider(IProgressMonitor monitor
)
84 throws ExecutionException
;
87 * Retrieves the UST provider information from the node.
89 * @return - the UST provider information.
90 * @throws ExecutionException
91 * If the command fails
93 public List
<IUstProviderInfo
> getUstProvider() throws ExecutionException
;
96 * Retrieves the UST provider information from the node.
99 * - a progress monitor
100 * @return the UST provider information.
101 * @throws ExecutionException
102 * If the command fails
104 public List
<IUstProviderInfo
> getUstProvider(IProgressMonitor monitor
)
105 throws ExecutionException
;
108 * Creates a session with given session name and location.
111 * - a session name to create
113 * - a path for storing the traces (use null for default)
115 * - a progress monitor
116 * @return the session information
117 * @throws ExecutionException
118 * If the command fails
120 public ISessionInfo
createSession(String sessionName
, String sessionPath
,
121 IProgressMonitor monitor
) throws ExecutionException
;
124 * Destroys a session with given session name.
127 * - a session name to destroy
129 * - a progress monitor
130 * @throws ExecutionException
131 * If the command fails
133 public void destroySession(String sessionName
, IProgressMonitor monitor
)
134 throws ExecutionException
;
137 * Starts a session with given session name.
140 * - a session name to start
142 * - a progress monitor
143 * @throws ExecutionException
144 * If the command fails
146 public void startSession(String sessionName
, IProgressMonitor monitor
)
147 throws ExecutionException
;
150 * Stops a session with given session name.
153 * - a session name to stop
155 * - a progress monitor
156 * @throws ExecutionException
157 * If the command fails
159 public void stopSession(String sessionName
, IProgressMonitor monitor
)
160 throws ExecutionException
;
163 * Enables a list of channels for given session and given channel
164 * information (configuration).
167 * - a session name to create
168 * @param channelNames
169 * - a list of channel names to be enabled
171 * - a flag to indicate Kernel or UST (true for Kernel, false for
174 * - channel information used for creation of a channel (or null
177 * - a progress monitor
178 * @throws ExecutionException
179 * If the command fails
181 public void enableChannels(String sessionName
, List
<String
> channelNames
,
182 boolean isKernel
, IChannelInfo info
, IProgressMonitor monitor
)
183 throws ExecutionException
;
186 * Disables a list of channels for given session and given channel
187 * information (configuration).
190 * - a session name to create
191 * @param channelNames
192 * - a list of channel names to be enabled
194 * - a flag to indicate Kernel or UST (true for Kernel, false for
197 * - a progress monitor
198 * @throws ExecutionException
199 * If the command fails
201 public void disableChannels(String sessionName
, List
<String
> channelNames
,
202 boolean isKernel
, IProgressMonitor monitor
)
203 throws ExecutionException
;
206 * Enables a list of events with no additional parameters.
211 * - a channel name or null for default channel
213 * - a list of event names to be enabled, or null (list of size =
216 * - a flag for indicating kernel or UST.
217 * @param filterExpression
218 * - a filter expression
220 * - a progress monitor
221 * @throws ExecutionException
222 * If the command fails
224 public void enableEvents(String sessionName
, String channelName
,
225 List
<String
> eventNames
, boolean isKernel
, String filterExpression
,
226 IProgressMonitor monitor
)
227 throws ExecutionException
;
231 * Enables all syscall events.
236 * - a channel name or null for default channel
238 * - a progress monitor
239 * @throws ExecutionException
240 * If the command fails
242 public void enableSyscalls(String sessionName
, String channelName
,
243 IProgressMonitor monitor
) throws ExecutionException
;
246 * Enables a dynamic probe or dynamic function entry/return probe.
251 * - a channel name or null for default channel
255 * - true for dynamic function entry/return probe else false
257 * - a dynamic probe information
259 * - a progress monitor
260 * @throws ExecutionException
261 * If the command fails
263 public void enableProbe(String sessionName
, String channelName
,
264 String eventName
, boolean isFunction
, String probe
,
265 IProgressMonitor monitor
) throws ExecutionException
;
268 * Enables events using log level
273 * - a channel name (null for default channel)
276 * @param logLevelType
280 * @param filterExpression
281 * - a filter expression
283 * - a progress monitor
284 * @throws ExecutionException
285 * If the command fails
287 public void enableLogLevel(String sessionName
, String channelName
,
288 String eventName
, LogLevelType logLevelType
, TraceLogLevel level
,
289 String filterExpression
,
290 IProgressMonitor monitor
) throws ExecutionException
;
293 * Disables a list of events with no additional parameters.
298 * - a channel name (null for default channel)
300 * - a list of event names to enabled.
302 * - a flag for indicating kernel or UST.
304 * - a progress monitor
305 * @throws ExecutionException
306 * If the command fails
308 public void disableEvent(String sessionName
, String channelName
,
309 List
<String
> eventNames
, boolean isKernel
, IProgressMonitor monitor
)
310 throws ExecutionException
;
313 * Gets all available context names to be added to channels/events.
316 * The progress monitor
317 * @return the list of available contexts
318 * @throws ExecutionException
319 * If the command fails
321 public List
<String
> getContextList(IProgressMonitor monitor
)
322 throws ExecutionException
;
325 * Add contexts to given channels and or events
330 * - a channel name (null for all channels)
332 * - a event name (null for all events)
334 * - a flag for indicating kernel or UST.
336 * - a list of name of contexts to add
338 * - a progress monitor
339 * @throws ExecutionException
340 * If the command fails
342 public void addContexts(String sessionName
, String channelName
,
343 String eventName
, boolean isKernel
, List
<String
> contexts
,
344 IProgressMonitor monitor
) throws ExecutionException
;
347 * Executes calibrate command to quantify LTTng overhead.
350 * - a flag for indicating kernel or UST.
352 * - a progress monitor
353 * @throws ExecutionException
354 * If the command fails
356 public void calibrate(boolean isKernel
, IProgressMonitor monitor
)
357 throws ExecutionException
;