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 * Creates a session with given session name and location.
127 * - a session name to create
129 * - a path for storing the traces (use null for default)
131 * - a flag to indicate no consumer
132 * @param disableConsumer
133 * - a flag to disable consumer
135 * - a progress monitor
136 * @return the session information
137 * @throws ExecutionException
138 * If the command fails
140 public ISessionInfo
createSession(String sessionName
, String sessionPath
, boolean noConsumer
, boolean disableConsumer
,
141 IProgressMonitor monitor
) throws ExecutionException
;
145 * Creates a session with given session name and location.
148 * - a session name to create
150 * - a network URL for common definition of data and control channel
151 * or null if separate definition of data and control channel
153 * - a URL for control channel (networkUrl has to be null, dataUrl has to be set)
155 * - a URL for data channel (networkUrl has to be null, controlUrl has to be set)
157 * - a flag to indicate no consumer
158 * @param disableConsumer
159 * - a flag to disable consumer
161 * - a progress monitor
162 * @return the session information
163 * @throws ExecutionException
164 * If the command fails
166 public ISessionInfo
createSession(String sessionName
, String networkUrl
, String controlUrl
, String dataUrl
, boolean noConsumer
, boolean disableConsumer
,
167 IProgressMonitor monitor
) throws ExecutionException
;
170 * Destroys a session with given session name.
173 * - a session name to destroy
175 * - a progress monitor
176 * @throws ExecutionException
177 * If the command fails
179 public void destroySession(String sessionName
, IProgressMonitor monitor
)
180 throws ExecutionException
;
183 * Starts a session with given session name.
186 * - a session name to start
188 * - a progress monitor
189 * @throws ExecutionException
190 * If the command fails
192 public void startSession(String sessionName
, IProgressMonitor monitor
)
193 throws ExecutionException
;
196 * Stops a session with given session name.
199 * - a session name to stop
201 * - a progress monitor
202 * @throws ExecutionException
203 * If the command fails
205 public void stopSession(String sessionName
, IProgressMonitor monitor
)
206 throws ExecutionException
;
209 * Enables a list of channels for given session and given channel
210 * information (configuration).
213 * - a session name to create
214 * @param channelNames
215 * - a list of channel names to be enabled
217 * - a flag to indicate Kernel or UST (true for Kernel, false for
220 * - channel information used for creation of a channel (or null
223 * - a progress monitor
224 * @throws ExecutionException
225 * If the command fails
227 public void enableChannels(String sessionName
, List
<String
> channelNames
,
228 boolean isKernel
, IChannelInfo info
, IProgressMonitor monitor
)
229 throws ExecutionException
;
232 * Disables a list of channels for given session and given channel
233 * information (configuration).
236 * - a session name to create
237 * @param channelNames
238 * - a list of channel names to be enabled
240 * - a flag to indicate Kernel or UST (true for Kernel, false for
243 * - a progress monitor
244 * @throws ExecutionException
245 * If the command fails
247 public void disableChannels(String sessionName
, List
<String
> channelNames
,
248 boolean isKernel
, IProgressMonitor monitor
)
249 throws ExecutionException
;
252 * Enables a list of events with no additional parameters.
257 * - a channel name or null for default channel
259 * - a list of event names to be enabled, or null (list of size =
262 * - a flag for indicating kernel or UST.
263 * @param filterExpression
264 * - a filter expression
266 * - a progress monitor
267 * @throws ExecutionException
268 * If the command fails
270 public void enableEvents(String sessionName
, String channelName
,
271 List
<String
> eventNames
, boolean isKernel
, String filterExpression
,
272 IProgressMonitor monitor
)
273 throws ExecutionException
;
277 * Enables all syscall events.
282 * - a channel name or null for default channel
284 * - a progress monitor
285 * @throws ExecutionException
286 * If the command fails
288 public void enableSyscalls(String sessionName
, String channelName
,
289 IProgressMonitor monitor
) throws ExecutionException
;
292 * Enables a dynamic probe or dynamic function entry/return probe.
297 * - a channel name or null for default channel
301 * - true for dynamic function entry/return probe else false
303 * - a dynamic probe information
305 * - a progress monitor
306 * @throws ExecutionException
307 * If the command fails
309 public void enableProbe(String sessionName
, String channelName
,
310 String eventName
, boolean isFunction
, String probe
,
311 IProgressMonitor monitor
) throws ExecutionException
;
314 * Enables events using log level
319 * - a channel name (null for default channel)
322 * @param logLevelType
326 * @param filterExpression
327 * - a filter expression
329 * - a progress monitor
330 * @throws ExecutionException
331 * If the command fails
333 public void enableLogLevel(String sessionName
, String channelName
,
334 String eventName
, LogLevelType logLevelType
, TraceLogLevel level
,
335 String filterExpression
,
336 IProgressMonitor monitor
) throws ExecutionException
;
339 * Disables a list of events with no additional parameters.
344 * - a channel name (null for default channel)
346 * - a list of event names to enabled.
348 * - a flag for indicating kernel or UST.
350 * - a progress monitor
351 * @throws ExecutionException
352 * If the command fails
354 public void disableEvent(String sessionName
, String channelName
,
355 List
<String
> eventNames
, boolean isKernel
, IProgressMonitor monitor
)
356 throws ExecutionException
;
359 * Gets all available context names to be added to channels/events.
362 * The progress monitor
363 * @return the list of available contexts
364 * @throws ExecutionException
365 * If the command fails
367 public List
<String
> getContextList(IProgressMonitor monitor
)
368 throws ExecutionException
;
371 * Add contexts to given channels and or events
376 * - a channel name (null for all channels)
378 * - a event name (null for all events)
380 * - a flag for indicating kernel or UST.
382 * - a list of name of contexts to add
384 * - a progress monitor
385 * @throws ExecutionException
386 * If the command fails
388 public void addContexts(String sessionName
, String channelName
,
389 String eventName
, boolean isKernel
, List
<String
> contexts
,
390 IProgressMonitor monitor
) throws ExecutionException
;
393 * Executes calibrate command to quantify LTTng overhead.
396 * - a flag for indicating kernel or UST.
398 * - a progress monitor
399 * @throws ExecutionException
400 * If the command fails
402 public void calibrate(boolean isKernel
, IProgressMonitor monitor
)
403 throws ExecutionException
;