Commit | Line | Data |
---|---|---|
eb1bab5b BH |
1 | /********************************************************************** |
2 | * Copyright (c) 2012 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 BH |
10 | * Bernd Hufmann - Initial API and implementation |
11 | **********************************************************************/ | |
115b4a01 | 12 | package org.eclipse.linuxtools.internal.lttng2.ui.views.control.service; |
eb1bab5b BH |
13 | |
14 | import java.util.List; | |
15 | ||
16 | import org.eclipse.core.commands.ExecutionException; | |
17 | import org.eclipse.core.runtime.IProgressMonitor; | |
9315aeee BH |
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; | |
eb1bab5b BH |
24 | |
25 | ||
dbd4432d | 26 | /** |
eb1bab5b | 27 | * <p> |
cfdb727a | 28 | * Interface for LTTng trace control command service. |
eb1bab5b | 29 | * </p> |
cfdb727a | 30 | * |
dbd4432d | 31 | * @author Bernd Hufmann |
eb1bab5b BH |
32 | */ |
33 | public interface ILttngControlService { | |
276c17e7 BH |
34 | |
35 | /** | |
36 | * @return the version string. | |
37 | */ | |
38 | public String getVersion(); | |
39 | ||
eb1bab5b BH |
40 | /** |
41 | * Retrieves the existing sessions names from the node. | |
cfdb727a AM |
42 | * |
43 | * @param monitor | |
44 | * - a progress monitor | |
eb1bab5b BH |
45 | * @return an array with session names. |
46 | * @throws ExecutionException | |
cfdb727a | 47 | * If the command fails |
eb1bab5b | 48 | */ |
cfdb727a AM |
49 | public String[] getSessionNames(IProgressMonitor monitor) |
50 | throws ExecutionException; | |
51 | ||
eb1bab5b BH |
52 | /** |
53 | * Retrieves the session information with the given name the node. | |
cfdb727a AM |
54 | * |
55 | * @param sessionName | |
56 | * - the session name | |
57 | * @param monitor | |
58 | * - a progress monitor | |
eb1bab5b BH |
59 | * @return session information |
60 | * @throws ExecutionException | |
cfdb727a AM |
61 | * If the command fails |
62 | */ | |
63 | public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) | |
64 | throws ExecutionException; | |
65 | ||
eb1bab5b BH |
66 | /** |
67 | * Retrieves the kernel provider information (i.e. the kernel events) | |
cfdb727a AM |
68 | * |
69 | * @param monitor | |
70 | * - a progress monitor | |
eb1bab5b BH |
71 | * @return the list of existing kernel events. |
72 | * @throws ExecutionException | |
cfdb727a | 73 | * If the command fails |
eb1bab5b | 74 | */ |
cfdb727a AM |
75 | public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) |
76 | throws ExecutionException; | |
77 | ||
eb1bab5b BH |
78 | /** |
79 | * Retrieves the UST provider information from the node. | |
cfdb727a | 80 | * |
eb1bab5b BH |
81 | * @return - the UST provider information. |
82 | * @throws ExecutionException | |
cfdb727a | 83 | * If the command fails |
eb1bab5b BH |
84 | */ |
85 | public List<IUstProviderInfo> getUstProvider() throws ExecutionException; | |
cfdb727a | 86 | |
eb1bab5b BH |
87 | /** |
88 | * Retrieves the UST provider information from the node. | |
cfdb727a AM |
89 | * |
90 | * @param monitor | |
91 | * - a progress monitor | |
bbb3538a | 92 | * @return the UST provider information. |
eb1bab5b | 93 | * @throws ExecutionException |
cfdb727a | 94 | * If the command fails |
eb1bab5b | 95 | */ |
cfdb727a AM |
96 | public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) |
97 | throws ExecutionException; | |
98 | ||
bbb3538a BH |
99 | /** |
100 | * Creates a session with given session name and location. | |
cfdb727a AM |
101 | * |
102 | * @param sessionName | |
103 | * - a session name to create | |
104 | * @param sessionPath | |
105 | * - a path for storing the traces (use null for default) | |
106 | * @param monitor | |
107 | * - a progress monitor | |
bbb3538a BH |
108 | * @return the session information |
109 | * @throws ExecutionException | |
cfdb727a | 110 | * If the command fails |
bbb3538a | 111 | */ |
cfdb727a AM |
112 | public ISessionInfo createSession(String sessionName, String sessionPath, |
113 | IProgressMonitor monitor) throws ExecutionException; | |
114 | ||
bbb3538a | 115 | /** |
cfdb727a AM |
116 | * Destroys a session with given session name. |
117 | * | |
118 | * @param sessionName | |
119 | * - a session name to destroy | |
120 | * @param monitor | |
121 | * - a progress monitor | |
bbb3538a | 122 | * @throws ExecutionException |
cfdb727a | 123 | * If the command fails |
bbb3538a | 124 | */ |
cfdb727a AM |
125 | public void destroySession(String sessionName, IProgressMonitor monitor) |
126 | throws ExecutionException; | |
bbb3538a BH |
127 | |
128 | /** | |
cfdb727a AM |
129 | * Starts a session with given session name. |
130 | * | |
131 | * @param sessionName | |
132 | * - a session name to start | |
133 | * @param monitor | |
134 | * - a progress monitor | |
bbb3538a | 135 | * @throws ExecutionException |
cfdb727a AM |
136 | * If the command fails |
137 | */ | |
138 | public void startSession(String sessionName, IProgressMonitor monitor) | |
139 | throws ExecutionException; | |
bbb3538a | 140 | |
cfdb727a AM |
141 | /** |
142 | * Stops a session with given session name. | |
143 | * | |
144 | * @param sessionName | |
145 | * - a session name to stop | |
146 | * @param monitor | |
147 | * - a progress monitor | |
148 | * @throws ExecutionException | |
149 | * If the command fails | |
150 | */ | |
151 | public void stopSession(String sessionName, IProgressMonitor monitor) | |
152 | throws ExecutionException; | |
bbb3538a | 153 | |
cfdb727a AM |
154 | /** |
155 | * Enables a list of channels for given session and given channel | |
156 | * information (configuration). | |
157 | * | |
158 | * @param sessionName | |
159 | * - a session name to create | |
160 | * @param channelNames | |
161 | * - a list of channel names to be enabled | |
162 | * @param isKernel | |
163 | * - a flag to indicate Kernel or UST (true for Kernel, false for | |
164 | * UST) | |
165 | * @param info | |
166 | * - channel information used for creation of a channel (or null | |
167 | * for default) | |
168 | * @param monitor | |
169 | * - a progress monitor | |
170 | * @throws ExecutionException | |
171 | * If the command fails | |
172 | */ | |
173 | public void enableChannels(String sessionName, List<String> channelNames, | |
174 | boolean isKernel, IChannelInfo info, IProgressMonitor monitor) | |
175 | throws ExecutionException; | |
bbb3538a | 176 | |
cfdb727a AM |
177 | /** |
178 | * Disables a list of channels for given session and given channel | |
179 | * information (configuration). | |
180 | * | |
181 | * @param sessionName | |
182 | * - a session name to create | |
183 | * @param channelNames | |
184 | * - a list of channel names to be enabled | |
185 | * @param isKernel | |
186 | * - a flag to indicate Kernel or UST (true for Kernel, false for | |
187 | * UST) | |
188 | * @param monitor | |
189 | * - a progress monitor | |
190 | * @throws ExecutionException | |
191 | * If the command fails | |
192 | */ | |
193 | public void disableChannels(String sessionName, List<String> channelNames, | |
194 | boolean isKernel, IProgressMonitor monitor) | |
195 | throws ExecutionException; | |
6503ae0f BH |
196 | |
197 | /** | |
198 | * Enables a list of events with no additional parameters. | |
cfdb727a AM |
199 | * |
200 | * @param sessionName | |
201 | * - a session name | |
202 | * @param channelName | |
203 | * - a channel name or null for default channel | |
204 | * @param eventNames | |
205 | * - a list of event names to be enabled, or null (list of size = | |
206 | * 0)for all events . | |
207 | * @param isKernel | |
208 | * - a flag for indicating kernel or UST. | |
209 | * @param monitor | |
210 | * - a progress monitor | |
6503ae0f | 211 | * @throws ExecutionException |
cfdb727a | 212 | * If the command fails |
6503ae0f | 213 | */ |
cfdb727a AM |
214 | public void enableEvents(String sessionName, String channelName, |
215 | List<String> eventNames, boolean isKernel, IProgressMonitor monitor) | |
216 | throws ExecutionException; | |
498704b3 BH |
217 | |
218 | /** | |
219 | * Enables all syscall events. | |
cfdb727a AM |
220 | * |
221 | * @param sessionName | |
222 | * - a session name | |
223 | * @param channelName | |
224 | * - a channel name or null for default channel | |
225 | * @param monitor | |
226 | * - a progress monitor | |
498704b3 | 227 | * @throws ExecutionException |
cfdb727a | 228 | * If the command fails |
498704b3 | 229 | */ |
cfdb727a AM |
230 | public void enableSyscalls(String sessionName, String channelName, |
231 | IProgressMonitor monitor) throws ExecutionException; | |
498704b3 BH |
232 | |
233 | /** | |
d132bcc7 | 234 | * Enables a dynamic probe or dynamic function entry/return probe. |
cfdb727a AM |
235 | * |
236 | * @param sessionName | |
237 | * - a session name | |
238 | * @param channelName | |
239 | * - a channel name or null for default channel | |
240 | * @param eventName | |
241 | * - a event name | |
242 | * @param isFunction | |
243 | * - true for dynamic function entry/return probe else false | |
244 | * @param probe | |
245 | * - a dynamic probe information | |
246 | * @param monitor | |
247 | * - a progress monitor | |
498704b3 | 248 | * @throws ExecutionException |
cfdb727a | 249 | * If the command fails |
498704b3 | 250 | */ |
cfdb727a AM |
251 | public void enableProbe(String sessionName, String channelName, |
252 | String eventName, boolean isFunction, String probe, | |
253 | IProgressMonitor monitor) throws ExecutionException; | |
498704b3 | 254 | |
ccc66d01 BH |
255 | /** |
256 | * Enables events using log level | |
cfdb727a AM |
257 | * |
258 | * @param sessionName | |
259 | * - a session name | |
260 | * @param channelName | |
261 | * - a channel name (null for default channel) | |
262 | * @param eventName | |
263 | * - a event name | |
264 | * @param logLevelType | |
265 | * - a log level type | |
266 | * @param level | |
267 | * - a log level | |
268 | * @param monitor | |
269 | * - a progress monitor | |
ccc66d01 | 270 | * @throws ExecutionException |
cfdb727a | 271 | * If the command fails |
ccc66d01 | 272 | */ |
cfdb727a AM |
273 | public void enableLogLevel(String sessionName, String channelName, |
274 | String eventName, LogLevelType logLevelType, TraceLogLevel level, | |
275 | IProgressMonitor monitor) throws ExecutionException; | |
276 | ||
6503ae0f BH |
277 | /** |
278 | * Disables a list of events with no additional parameters. | |
cfdb727a AM |
279 | * |
280 | * @param sessionName | |
281 | * - a session name | |
282 | * @param channelName | |
283 | * - a channel name (null for default channel) | |
284 | * @param eventNames | |
285 | * - a list of event names to enabled. | |
286 | * @param isKernel | |
287 | * - a flag for indicating kernel or UST. | |
288 | * @param monitor | |
289 | * - a progress monitor | |
6503ae0f | 290 | * @throws ExecutionException |
cfdb727a | 291 | * If the command fails |
6503ae0f | 292 | */ |
cfdb727a AM |
293 | public void disableEvent(String sessionName, String channelName, |
294 | List<String> eventNames, boolean isKernel, IProgressMonitor monitor) | |
295 | throws ExecutionException; | |
296 | ||
b793fbe1 BH |
297 | /** |
298 | * Gets all available context names to be added to channels/events. | |
cfdb727a | 299 | * |
b793fbe1 | 300 | * @param monitor |
cfdb727a | 301 | * The progress monitor |
b793fbe1 | 302 | * @return the list of available contexts |
cfdb727a AM |
303 | * @throws ExecutionException |
304 | * If the command fails | |
b793fbe1 | 305 | */ |
cfdb727a AM |
306 | public List<String> getContextList(IProgressMonitor monitor) |
307 | throws ExecutionException; | |
308 | ||
b793fbe1 BH |
309 | /** |
310 | * Add contexts to given channels and or events | |
cfdb727a AM |
311 | * |
312 | * @param sessionName | |
313 | * - a session name | |
314 | * @param channelName | |
315 | * - a channel name (null for all channels) | |
316 | * @param eventName | |
317 | * - a event name (null for all events) | |
318 | * @param isKernel | |
319 | * - a flag for indicating kernel or UST. | |
320 | * @param contexts | |
321 | * - a list of name of contexts to add | |
322 | * @param monitor | |
323 | * - a progress monitor | |
b793fbe1 | 324 | * @throws ExecutionException |
cfdb727a | 325 | * If the command fails |
b793fbe1 | 326 | */ |
cfdb727a AM |
327 | public void addContexts(String sessionName, String channelName, |
328 | String eventName, boolean isKernel, List<String> contexts, | |
329 | IProgressMonitor monitor) throws ExecutionException; | |
330 | ||
b720ac44 BH |
331 | /** |
332 | * Executes calibrate command to quantify LTTng overhead. | |
cfdb727a AM |
333 | * |
334 | * @param isKernel | |
335 | * - a flag for indicating kernel or UST. | |
336 | * @param monitor | |
337 | * - a progress monitor | |
b720ac44 | 338 | * @throws ExecutionException |
cfdb727a | 339 | * If the command fails |
b720ac44 | 340 | */ |
cfdb727a AM |
341 | public void calibrate(boolean isKernel, IProgressMonitor monitor) |
342 | throws ExecutionException; | |
eb1bab5b | 343 | } |