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