tmf-remote: Bug 460842: clean-up ICommandShell and ICommandResult APIs
[deliverable/tracecompass.git] / org.eclipse.tracecompass.lttng2.control.ui / src / org / eclipse / tracecompass / internal / lttng2 / control / ui / views / service / ILttngControlService.java
CommitLineData
eb1bab5b 1/**********************************************************************
ed902a2b 2 * Copyright (c) 2012, 2014 Ericsson
cfdb727a 3 *
eb1bab5b
BH
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
cfdb727a
AM
8 *
9 * Contributors:
eb1bab5b 10 * Bernd Hufmann - Initial API and implementation
ba3a9bd2 11 * Bernd Hufmann - Updated for support of LTTng Tools 2.1
eb1bab5b 12 **********************************************************************/
9bc60be7 13package org.eclipse.tracecompass.internal.lttng2.control.ui.views.service;
eb1bab5b
BH
14
15import java.util.List;
16
17import org.eclipse.core.commands.ExecutionException;
18import org.eclipse.core.runtime.IProgressMonitor;
9bc60be7
AM
19import org.eclipse.tracecompass.internal.lttng2.control.core.model.IBaseEventInfo;
20import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
21import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISessionInfo;
22import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISnapshotInfo;
23import org.eclipse.tracecompass.internal.lttng2.control.core.model.IUstProviderInfo;
24import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
25import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
eb1bab5b
BH
26
27
dbd4432d 28/**
eb1bab5b 29* <p>
cfdb727a 30* Interface for LTTng trace control command service.
eb1bab5b 31* </p>
cfdb727a 32*
dbd4432d 33* @author Bernd Hufmann
eb1bab5b
BH
34*/
35public interface ILttngControlService {
276c17e7
BH
36
37 /**
0df4af5f 38 * @return the LTTng version object
276c17e7 39 */
0df4af5f
JRJ
40 LttngVersion getVersion();
41
42 /**
43 * @return the version string
44 */
45 String getVersionString();
276c17e7 46
d4514365
BH
47 /**
48 * Checks if given version is supported by this ILTTngControlService implementation.
49 *
50 * @param version The version to check
51 * @return <code>true</code> if version is supported else <code>false</code>
52 */
046b6849 53 boolean isVersionSupported(String version);
d4514365 54
eb1bab5b
BH
55 /**
56 * Retrieves the existing sessions names from the node.
cfdb727a
AM
57 *
58 * @param monitor
59 * - a progress monitor
eb1bab5b
BH
60 * @return an array with session names.
61 * @throws ExecutionException
cfdb727a 62 * If the command fails
eb1bab5b 63 */
046b6849 64 String[] getSessionNames(IProgressMonitor monitor)
cfdb727a
AM
65 throws ExecutionException;
66
eb1bab5b
BH
67 /**
68 * Retrieves the session information with the given name the node.
cfdb727a
AM
69 *
70 * @param sessionName
71 * - the session name
72 * @param monitor
73 * - a progress monitor
eb1bab5b
BH
74 * @return session information
75 * @throws ExecutionException
cfdb727a
AM
76 * If the command fails
77 */
046b6849 78 ISessionInfo getSession(String sessionName, IProgressMonitor monitor)
cfdb727a
AM
79 throws ExecutionException;
80
589d0d33
BH
81 /**
82 * Retrieves the snapshot output information from the node
83 * @param sessionName
84 * - the session name
85 * @param monitor
86 * - a progress monitor
87 * @return snapshot output information
88 * @throws ExecutionException
89 * if command fails
90 */
91 ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor)
92 throws ExecutionException;
93
eb1bab5b
BH
94 /**
95 * Retrieves the kernel provider information (i.e. the kernel events)
cfdb727a
AM
96 *
97 * @param monitor
98 * - a progress monitor
eb1bab5b
BH
99 * @return the list of existing kernel events.
100 * @throws ExecutionException
cfdb727a 101 * If the command fails
eb1bab5b 102 */
046b6849 103 List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor)
cfdb727a
AM
104 throws ExecutionException;
105
eb1bab5b
BH
106 /**
107 * Retrieves the UST provider information from the node.
cfdb727a 108 *
eb1bab5b
BH
109 * @return - the UST provider information.
110 * @throws ExecutionException
cfdb727a 111 * If the command fails
eb1bab5b
BH
112 */
113 public List<IUstProviderInfo> getUstProvider() throws ExecutionException;
cfdb727a 114
eb1bab5b
BH
115 /**
116 * Retrieves the UST provider information from the node.
cfdb727a
AM
117 *
118 * @param monitor
119 * - a progress monitor
bbb3538a 120 * @return the UST provider information.
eb1bab5b 121 * @throws ExecutionException
cfdb727a 122 * If the command fails
eb1bab5b 123 */
046b6849 124 List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor)
cfdb727a
AM
125 throws ExecutionException;
126
bbb3538a
BH
127 /**
128 * Creates a session with given session name and location.
cfdb727a 129 *
f7d4d450
MAL
130 * @param sessionInfo
131 * the session information used to create the session
cfdb727a
AM
132 * @param monitor
133 * - a progress monitor
f3b33d40 134 *
f3b33d40
BH
135 * @return the session information
136 * @throws ExecutionException
137 * If the command fails
138 */
f7d4d450 139 ISessionInfo createSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException;
f3b33d40 140
bbb3538a 141 /**
cfdb727a
AM
142 * Destroys a session with given session name.
143 *
144 * @param sessionName
145 * - a session name to destroy
146 * @param monitor
147 * - a progress monitor
bbb3538a 148 * @throws ExecutionException
cfdb727a 149 * If the command fails
bbb3538a 150 */
046b6849 151 void destroySession(String sessionName, IProgressMonitor monitor)
cfdb727a 152 throws ExecutionException;
bbb3538a
BH
153
154 /**
cfdb727a
AM
155 * Starts a session with given session name.
156 *
157 * @param sessionName
158 * - a session name to start
159 * @param monitor
160 * - a progress monitor
bbb3538a 161 * @throws ExecutionException
cfdb727a
AM
162 * If the command fails
163 */
046b6849 164 void startSession(String sessionName, IProgressMonitor monitor)
cfdb727a 165 throws ExecutionException;
bbb3538a 166
cfdb727a
AM
167 /**
168 * Stops a session with given session name.
169 *
170 * @param sessionName
171 * - a session name to stop
172 * @param monitor
173 * - a progress monitor
174 * @throws ExecutionException
175 * If the command fails
176 */
046b6849 177 void stopSession(String sessionName, IProgressMonitor monitor)
cfdb727a 178 throws ExecutionException;
bbb3538a 179
cfdb727a
AM
180 /**
181 * Enables a list of channels for given session and given channel
182 * information (configuration).
183 *
184 * @param sessionName
185 * - a session name to create
186 * @param channelNames
187 * - a list of channel names to be enabled
188 * @param isKernel
189 * - a flag to indicate Kernel or UST (true for Kernel, false for
190 * UST)
191 * @param info
192 * - channel information used for creation of a channel (or null
193 * for default)
194 * @param monitor
195 * - a progress monitor
196 * @throws ExecutionException
197 * If the command fails
198 */
046b6849 199 void enableChannels(String sessionName, List<String> channelNames,
cfdb727a
AM
200 boolean isKernel, IChannelInfo info, IProgressMonitor monitor)
201 throws ExecutionException;
bbb3538a 202
cfdb727a
AM
203 /**
204 * Disables a list of channels for given session and given channel
205 * information (configuration).
206 *
207 * @param sessionName
208 * - a session name to create
209 * @param channelNames
210 * - a list of channel names to be enabled
211 * @param isKernel
212 * - a flag to indicate Kernel or UST (true for Kernel, false for
213 * UST)
214 * @param monitor
215 * - a progress monitor
216 * @throws ExecutionException
217 * If the command fails
218 */
046b6849 219 void disableChannels(String sessionName, List<String> channelNames,
cfdb727a
AM
220 boolean isKernel, IProgressMonitor monitor)
221 throws ExecutionException;
6503ae0f
BH
222
223 /**
224 * Enables a list of events with no additional parameters.
cfdb727a
AM
225 *
226 * @param sessionName
227 * - a session name
228 * @param channelName
229 * - a channel name or null for default channel
230 * @param eventNames
231 * - a list of event names to be enabled, or null (list of size =
232 * 0)for all events .
233 * @param isKernel
234 * - a flag for indicating kernel or UST.
d4514365
BH
235 * @param filterExpression
236 * - a filter expression
cfdb727a
AM
237 * @param monitor
238 * - a progress monitor
6503ae0f 239 * @throws ExecutionException
cfdb727a 240 * If the command fails
6503ae0f 241 */
046b6849 242 void enableEvents(String sessionName, String channelName,
d4514365
BH
243 List<String> eventNames, boolean isKernel, String filterExpression,
244 IProgressMonitor monitor)
cfdb727a 245 throws ExecutionException;
498704b3 246
d4514365 247
498704b3
BH
248 /**
249 * Enables all syscall events.
cfdb727a
AM
250 *
251 * @param sessionName
252 * - a session name
253 * @param channelName
254 * - a channel name or null for default channel
255 * @param monitor
256 * - a progress monitor
498704b3 257 * @throws ExecutionException
cfdb727a 258 * If the command fails
498704b3 259 */
046b6849 260 void enableSyscalls(String sessionName, String channelName,
cfdb727a 261 IProgressMonitor monitor) throws ExecutionException;
498704b3
BH
262
263 /**
d132bcc7 264 * Enables a dynamic probe or dynamic function entry/return probe.
cfdb727a
AM
265 *
266 * @param sessionName
267 * - a session name
268 * @param channelName
269 * - a channel name or null for default channel
270 * @param eventName
271 * - a event name
272 * @param isFunction
273 * - true for dynamic function entry/return probe else false
274 * @param probe
275 * - a dynamic probe information
276 * @param monitor
277 * - a progress monitor
498704b3 278 * @throws ExecutionException
cfdb727a 279 * If the command fails
498704b3 280 */
046b6849 281 void enableProbe(String sessionName, String channelName,
cfdb727a
AM
282 String eventName, boolean isFunction, String probe,
283 IProgressMonitor monitor) throws ExecutionException;
498704b3 284
ccc66d01
BH
285 /**
286 * Enables events using log level
cfdb727a
AM
287 *
288 * @param sessionName
289 * - a session name
290 * @param channelName
291 * - a channel name (null for default channel)
292 * @param eventName
293 * - a event name
294 * @param logLevelType
295 * - a log level type
296 * @param level
297 * - a log level
d4514365
BH
298 * @param filterExpression
299 * - a filter expression
cfdb727a
AM
300 * @param monitor
301 * - a progress monitor
ccc66d01 302 * @throws ExecutionException
cfdb727a 303 * If the command fails
ccc66d01 304 */
046b6849 305 void enableLogLevel(String sessionName, String channelName,
cfdb727a 306 String eventName, LogLevelType logLevelType, TraceLogLevel level,
d4514365 307 String filterExpression,
cfdb727a
AM
308 IProgressMonitor monitor) throws ExecutionException;
309
6503ae0f
BH
310 /**
311 * Disables a list of events with no additional parameters.
cfdb727a
AM
312 *
313 * @param sessionName
314 * - a session name
315 * @param channelName
316 * - a channel name (null for default channel)
317 * @param eventNames
318 * - a list of event names to enabled.
319 * @param isKernel
320 * - a flag for indicating kernel or UST.
321 * @param monitor
322 * - a progress monitor
6503ae0f 323 * @throws ExecutionException
cfdb727a 324 * If the command fails
6503ae0f 325 */
046b6849 326 void disableEvent(String sessionName, String channelName,
cfdb727a
AM
327 List<String> eventNames, boolean isKernel, IProgressMonitor monitor)
328 throws ExecutionException;
329
b793fbe1
BH
330 /**
331 * Gets all available context names to be added to channels/events.
cfdb727a 332 *
b793fbe1 333 * @param monitor
cfdb727a 334 * The progress monitor
b793fbe1 335 * @return the list of available contexts
cfdb727a
AM
336 * @throws ExecutionException
337 * If the command fails
b793fbe1 338 */
046b6849 339 List<String> getContextList(IProgressMonitor monitor)
cfdb727a
AM
340 throws ExecutionException;
341
b793fbe1
BH
342 /**
343 * Add contexts to given channels and or events
cfdb727a
AM
344 *
345 * @param sessionName
346 * - a session name
347 * @param channelName
348 * - a channel name (null for all channels)
349 * @param eventName
350 * - a event name (null for all events)
351 * @param isKernel
352 * - a flag for indicating kernel or UST.
353 * @param contexts
354 * - a list of name of contexts to add
355 * @param monitor
356 * - a progress monitor
b793fbe1 357 * @throws ExecutionException
cfdb727a 358 * If the command fails
b793fbe1 359 */
046b6849 360 void addContexts(String sessionName, String channelName,
cfdb727a
AM
361 String eventName, boolean isKernel, List<String> contexts,
362 IProgressMonitor monitor) throws ExecutionException;
363
b720ac44
BH
364 /**
365 * Executes calibrate command to quantify LTTng overhead.
cfdb727a
AM
366 *
367 * @param isKernel
368 * - a flag for indicating kernel or UST.
369 * @param monitor
370 * - a progress monitor
b720ac44 371 * @throws ExecutionException
cfdb727a 372 * If the command fails
b720ac44 373 */
046b6849 374 void calibrate(boolean isKernel, IProgressMonitor monitor)
cfdb727a 375 throws ExecutionException;
589d0d33
BH
376
377 /**
378 * Records a snapshot.
379 *
380 * @param sessionName
381 * - a session name
382 * @param monitor
383 * - a progress monitor
384 * @throws ExecutionException
385 * If the command fails
386 */
387 void recordSnapshot(String sessionName, IProgressMonitor monitor)
388 throws ExecutionException;
64a37b87
BH
389
390 /**
391 * Executes a list of commands
392 *
393 * @param monitor
394 * - a progress monitor
395 * @param commands
396 * - array of commands
397 * @throws ExecutionException
398 * If a command fails
399 */
400 void runCommands(IProgressMonitor monitor, List<String> commands)
401 throws ExecutionException;
eb1bab5b 402}
This page took 0.081854 seconds and 5 git commands to generate.