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