Commit | Line | Data |
---|---|---|
eb1bab5b BH |
1 | /********************************************************************** |
2 | * Copyright (c) 2012 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 | **********************************************************************/ | |
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 BH |
27 | * <p> |
28 | * Interface for LTTng trace control command service. | |
29 | * </p> | |
dbd4432d BH |
30 | * |
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. | |
42 | * @param monitor - a progress monitor | |
43 | * @return an array with session names. | |
44 | * @throws ExecutionException | |
45 | */ | |
46 | public String[] getSessionNames(IProgressMonitor monitor) throws ExecutionException; | |
47 | ||
eb1bab5b BH |
48 | /** |
49 | * Retrieves the session information with the given name the node. | |
50 | * @param sessionName - the session name | |
51 | * @param monitor - a progress monitor | |
52 | * @return session information | |
53 | * @throws ExecutionException | |
54 | */ | |
55 | public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) throws ExecutionException; | |
56 | ||
eb1bab5b BH |
57 | /** |
58 | * Retrieves the kernel provider information (i.e. the kernel events) | |
59 | * @param monitor - a progress monitor | |
60 | * @return the list of existing kernel events. | |
61 | * @throws ExecutionException | |
62 | */ | |
63 | public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) throws ExecutionException; | |
64 | ||
65 | /** | |
66 | * Retrieves the UST provider information from the node. | |
67 | * @return - the UST provider information. | |
68 | * @throws ExecutionException | |
69 | */ | |
70 | public List<IUstProviderInfo> getUstProvider() throws ExecutionException; | |
71 | /** | |
72 | * Retrieves the UST provider information from the node. | |
73 | * @param monitor - a progress monitor | |
bbb3538a | 74 | * @return the UST provider information. |
eb1bab5b BH |
75 | * @throws ExecutionException |
76 | */ | |
77 | public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException; | |
bbb3538a BH |
78 | |
79 | /** | |
80 | * Creates a session with given session name and location. | |
81 | * @param sessionName - a session name to create | |
82 | * @param sessionPath - a path for storing the traces (use null for default) | |
83 | * @param monitor - a progress monitor | |
84 | * @return the session information | |
85 | * @throws ExecutionException | |
86 | */ | |
87 | public ISessionInfo createSession(String sessionName, String sessionPath, IProgressMonitor monitor) throws ExecutionException; | |
88 | ||
89 | /** | |
90 | * Destroys a session with given session name. | |
91 | * @param sessionName - a session name to destroy | |
92 | * @param monitor - a progress monitor | |
93 | * @throws ExecutionException | |
94 | */ | |
95 | public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException; | |
96 | ||
97 | /** | |
98 | * Starts a session with given session name. | |
99 | * @param sessionName - a session name to start | |
100 | * @param monitor - a progress monitor | |
101 | * @throws ExecutionException | |
102 | */ | |
103 | public void startSession(String sessionName, IProgressMonitor monitor) throws ExecutionException; | |
104 | ||
105 | /** | |
106 | * Stops a session with given session name. | |
107 | * @param sessionName - a session name to stop | |
108 | * @param monitor - a progress monitor | |
109 | * @throws ExecutionException | |
110 | */ | |
111 | public void stopSession(String sessionName, IProgressMonitor monitor) throws ExecutionException; | |
112 | ||
113 | ||
114 | /** | |
115 | * Enables a list of channels for given session and given channel information (configuration). | |
116 | * @param sessionName - a session name to create | |
d132bcc7 | 117 | * @param channelNames - a list of channel names to be enabled |
bbb3538a BH |
118 | * @param isKernel - a flag to indicate Kernel or UST (true for Kernel, false for UST) |
119 | * @param info - channel information used for creation of a channel (or null for default) | |
120 | * @param monitor - a progress monitor | |
121 | * @throws ExecutionException | |
122 | */ | |
498704b3 | 123 | public void enableChannels(String sessionName, List<String> channelNames, boolean isKernel, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException; |
bbb3538a BH |
124 | |
125 | /** | |
126 | * Disables a list of channels for given session and given channel information (configuration). | |
127 | * @param sessionName - a session name to create | |
d132bcc7 | 128 | * @param channelNames - a list of channel names to be enabled |
bbb3538a BH |
129 | * @param isKernel - a flag to indicate Kernel or UST (true for Kernel, false for UST) |
130 | * @param monitor - a progress monitor | |
131 | * @throws ExecutionException | |
132 | */ | |
498704b3 | 133 | public void disableChannels(String sessionName, List<String> channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException; |
6503ae0f BH |
134 | |
135 | /** | |
136 | * Enables a list of events with no additional parameters. | |
137 | * @param sessionName - a session name | |
d132bcc7 BH |
138 | * @param channelName - a channel name or null for default channel |
139 | * @param eventNames - a list of event names to be enabled, or null (list of size = 0)for all events . | |
6503ae0f BH |
140 | * @param isKernel - a flag for indicating kernel or UST. |
141 | * @param monitor - a progress monitor | |
142 | * @throws ExecutionException | |
143 | */ | |
498704b3 BH |
144 | public void enableEvents(String sessionName, String channelName, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException; |
145 | ||
146 | /** | |
147 | * Enables all syscall events. | |
148 | * @param sessionName - a session name | |
d132bcc7 | 149 | * @param channelName - a channel name or null for default channel |
498704b3 BH |
150 | * @param monitor - a progress monitor |
151 | * @throws ExecutionException | |
152 | */ | |
153 | public void enableSyscalls(String sessionName, String channelName, IProgressMonitor monitor) throws ExecutionException; | |
154 | ||
155 | /** | |
d132bcc7 | 156 | * Enables a dynamic probe or dynamic function entry/return probe. |
498704b3 | 157 | * @param sessionName - a session name |
d132bcc7 | 158 | * @param channelName - a channel name or null for default channel |
498704b3 | 159 | * @param eventName - a event name |
d132bcc7 | 160 | * @param isFunction - true for dynamic function entry/return probe else false |
ccc66d01 BH |
161 | * @param probe - a dynamic probe information |
162 | * @param monitor - a progress monitor | |
498704b3 BH |
163 | * @throws ExecutionException |
164 | */ | |
d132bcc7 | 165 | public void enableProbe(String sessionName, String channelName, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException; |
498704b3 | 166 | |
ccc66d01 BH |
167 | /** |
168 | * Enables events using log level | |
169 | * @param sessionName - a session name | |
170 | * @param channelName - a channel name (null for default channel) | |
171 | * @param eventName - a event name | |
172 | * @param logLevelType - a log level type | |
173 | * @param level - a log level | |
174 | * @param monitor - a progress monitor | |
175 | * @throws ExecutionException | |
176 | */ | |
177 | public void enableLogLevel(String sessionName, String channelName, String eventName, LogLevelType logLevelType, TraceLogLevel level, IProgressMonitor monitor) throws ExecutionException; | |
178 | ||
6503ae0f BH |
179 | /** |
180 | * Disables a list of events with no additional parameters. | |
181 | * @param sessionName - a session name | |
182 | * @param channelName - a channel name (null for default channel) | |
183 | * @param eventNames - a list of event names to enabled. | |
184 | * @param isKernel - a flag for indicating kernel or UST. | |
185 | * @param monitor - a progress monitor | |
186 | * @throws ExecutionException | |
187 | */ | |
188 | public void disableEvent(String sessionName, String channelName, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException; | |
b793fbe1 BH |
189 | |
190 | /** | |
191 | * Gets all available context names to be added to channels/events. | |
192 | * @param monitor | |
193 | * @return the list of available contexts | |
194 | */ | |
195 | public List<String> getContextList(IProgressMonitor monitor) throws ExecutionException; | |
196 | ||
197 | /** | |
198 | * Add contexts to given channels and or events | |
199 | * @param sessionName - a session name | |
200 | * @param channelName - a channel name (null for all channels) | |
201 | * @param eventName - a event name (null for all events) | |
202 | * @param isKernel - a flag for indicating kernel or UST. | |
203 | * @param contexts - a list of name of contexts to add | |
204 | * @param monitor - a progress monitor | |
205 | * @throws ExecutionException | |
206 | */ | |
207 | public void addContexts(String sessionName, String channelName, String eventName, boolean isKernel, List<String> contexts, IProgressMonitor monitor) throws ExecutionException; | |
b720ac44 BH |
208 | |
209 | /** | |
210 | * Executes calibrate command to quantify LTTng overhead. | |
211 | * @param isKernel - a flag for indicating kernel or UST. | |
212 | * @param monitor - a progress monitor | |
213 | * @throws ExecutionException | |
214 | */ | |
215 | public void calibrate(boolean isKernel, IProgressMonitor monitor) throws ExecutionException; | |
eb1bab5b | 216 | } |