Commit | Line | Data |
---|---|---|
276c17e7 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 | **********************************************************************/ | |
12 | package org.eclipse.linuxtools.internal.lttng2.ui.views.control.service; | |
13 | ||
14 | import java.util.regex.Pattern; | |
15 | ||
16 | /** | |
276c17e7 BH |
17 | * <p> |
18 | * Constants for LTTng Control Service. | |
19 | * </p> | |
dbd4432d BH |
20 | * |
21 | * @author Bernd Hufmann | |
276c17e7 BH |
22 | */ |
23 | public class LTTngControlServiceConstants { | |
24 | ||
25 | // ------------------------------------------------------------------------ | |
26 | // Version constants | |
27 | // ------------------------------------------------------------------------ | |
28 | public final static String LTTNG_MAJOR_VERSION_2_0 = "2.0"; //$NON-NLS-1$ | |
29 | ||
30 | // ------------------------------------------------------------------------ | |
31 | // Command constants | |
32 | // ------------------------------------------------------------------------ | |
33 | /** | |
34 | * The lttng tools command. | |
35 | */ | |
36 | public final static String CONTROL_COMMAND = "lttng"; //$NON-NLS-1$ | |
37 | /** | |
38 | * Command: lttng version. | |
39 | */ | |
40 | public final static String COMMAND_VERSION = " version "; //$NON-NLS-1$ | |
41 | /** | |
42 | * Command: lttng list. | |
43 | */ | |
44 | public final static String COMMAND_LIST = " list "; //$NON-NLS-1$ | |
45 | /** | |
46 | * Command to list kernel tracer information. | |
47 | */ | |
48 | public final static String COMMAND_LIST_KERNEL = COMMAND_LIST + "-k"; //$NON-NLS-1$ | |
49 | /** | |
50 | * Command to list user space trace information. | |
51 | */ | |
52 | public final static String COMMAND_LIST_UST = COMMAND_LIST + "-u"; //$NON-NLS-1$ | |
53 | /** | |
54 | * Command to create a session. | |
55 | */ | |
56 | public final static String COMMAND_CREATE_SESSION = " create "; //$NON-NLS-1$ | |
57 | /** | |
58 | * Command to destroy a session. | |
59 | */ | |
60 | public final static String COMMAND_DESTROY_SESSION = " destroy "; //$NON-NLS-1$ | |
61 | /** | |
62 | * Command to destroy a session. | |
63 | */ | |
64 | public final static String COMMAND_START_SESSION = " start "; //$NON-NLS-1$ | |
65 | /** | |
66 | * Command to destroy a session. | |
67 | */ | |
68 | public final static String COMMAND_STOP_SESSION = " stop "; //$NON-NLS-1$ | |
69 | /** | |
70 | * Command to enable a channel. | |
71 | */ | |
72 | public final static String COMMAND_ENABLE_CHANNEL = " enable-channel "; //$NON-NLS-1$ | |
73 | /** | |
74 | * Command to disable a channel. | |
75 | */ | |
76 | public final static String COMMAND_DISABLE_CHANNEL = " disable-channel "; //$NON-NLS-1$ | |
77 | /** | |
78 | * Command to enable a event. | |
79 | */ | |
80 | public final static String COMMAND_ENABLE_EVENT = " enable-event "; //$NON-NLS-1$ | |
81 | /** | |
82 | * Command to disable a event. | |
83 | */ | |
84 | public final static String COMMAND_DISABLE_EVENT = " disable-event "; //$NON-NLS-1$ | |
85 | /** | |
86 | * Command to add a context to channels and/or events | |
87 | */ | |
88 | public final static String COMMAND_ADD_CONTEXT = " add-context "; //$NON-NLS-1$ | |
89 | /** | |
90 | * Command to execute calibrate command to quantify LTTng overhead | |
91 | */ | |
92 | public final static String COMMAND_CALIBRATE = " calibrate "; //$NON-NLS-1$ | |
93 | ||
94 | // ------------------------------------------------------------------------ | |
95 | // Command line options constants | |
96 | // ------------------------------------------------------------------------ | |
97 | /** | |
98 | * Command line option to add tracing group of user. | |
99 | */ | |
100 | public final static String OPTION_TRACING_GROUP = " -g "; //$NON-NLS-1$ | |
101 | /** | |
102 | * Command line option for verbose output. | |
103 | */ | |
104 | public final static String OPTION_VERBOSE = " -v "; //$NON-NLS-1$ | |
105 | /** | |
106 | * Command line option for verbose output. | |
107 | */ | |
108 | public final static String OPTION_VERY_VERBOSE = " -vv "; //$NON-NLS-1$ | |
109 | /** | |
110 | * Command line option for verbose output. | |
111 | */ | |
112 | public final static String OPTION_VERY_VERY_VERBOSE = " -vvv "; //$NON-NLS-1$ | |
113 | /** | |
114 | * Command line option for output path. | |
115 | */ | |
116 | public final static String OPTION_OUTPUT_PATH = " -o "; //$NON-NLS-1$ | |
117 | /** | |
118 | * Command line option for kernel tracer. | |
119 | */ | |
120 | public final static String OPTION_KERNEL = " -k "; //$NON-NLS-1$ | |
121 | /** | |
122 | * Command line option for UST tracer. | |
123 | */ | |
124 | public final static String OPTION_UST = " -u "; //$NON-NLS-1$ | |
125 | /** | |
126 | * Command line option for specifying a session. | |
127 | */ | |
128 | public final static String OPTION_SESSION = " -s "; //$NON-NLS-1$ | |
129 | /** | |
130 | * Command line option for specifying a channel. | |
131 | */ | |
132 | public final static String OPTION_CHANNEL = " -c "; //$NON-NLS-1$ | |
133 | /** | |
134 | * Command line option for specifying a event. | |
135 | */ | |
136 | public final static String OPTION_EVENT = " -e "; //$NON-NLS-1$ | |
137 | /** | |
138 | * Command line option for specifying all events. | |
139 | */ | |
140 | public final static String OPTION_ALL = " -a "; //$NON-NLS-1$ | |
141 | /** | |
142 | * Command line option for specifying a context. | |
143 | */ | |
144 | public final static String OPTION_CONTEXT_TYPE = " -t "; //$NON-NLS-1$ | |
145 | /** | |
146 | * Command line option for specifying tracepoint events. | |
147 | */ | |
148 | public final static String OPTION_TRACEPOINT = " --tracepoint "; //$NON-NLS-1$ | |
149 | /** | |
150 | * Command line option for specifying syscall events. | |
151 | */ | |
152 | public final static String OPTION_SYSCALL = " --syscall "; //$NON-NLS-1$ | |
153 | /** | |
154 | * Command line option for specifying a dynamic probe. | |
155 | */ | |
156 | public final static String OPTION_PROBE = " --probe "; //$NON-NLS-1$ | |
157 | /** | |
158 | * Command line option for specifying a dynamic function entry/return probe. | |
159 | */ | |
160 | public final static String OPTION_FUNCTION_PROBE = " --function "; //$NON-NLS-1$ | |
161 | /** | |
162 | * Command line option for specifying a log level range. | |
163 | */ | |
164 | public final static String OPTION_LOGLEVEL = " --loglevel "; //$NON-NLS-1$ | |
165 | /** | |
166 | * Command line option for specifying a specific log level. | |
167 | */ | |
168 | public final static String OPTION_LOGLEVEL_ONLY = " --loglevel-only "; //$NON-NLS-1$ | |
169 | /** | |
170 | * Optional command line option for configuring a channel's overwrite mode. | |
171 | */ | |
172 | public final static String OPTION_OVERWRITE = " --overwrite "; //$NON-NLS-1$ | |
173 | /** | |
174 | * Optional command line option for configuring a channel's number of sub buffers. | |
175 | */ | |
176 | public final static String OPTION_NUM_SUB_BUFFERS = " --num-subbuf "; //$NON-NLS-1$ | |
177 | /** | |
178 | * Optional command line option for configuring a channel's sub buffer size. | |
179 | */ | |
180 | public final static String OPTION_SUB_BUFFER_SIZE = " --subbuf-size "; //$NON-NLS-1$ | |
181 | /** | |
182 | * Optional command line option for configuring a channel's switch timer interval. | |
183 | */ | |
184 | public final static String OPTION_SWITCH_TIMER = " --switch-timer "; //$NON-NLS-1$ | |
185 | /** | |
186 | * Optional command line option for configuring a channel's read timer interval. | |
187 | */ | |
188 | public final static String OPTION_READ_TIMER = " --read-timer "; //$NON-NLS-1$ | |
189 | /** | |
190 | * Command line option for printing the help of a specif command | |
191 | */ | |
192 | public final static String OPTION_HELP = " -h "; //$NON-NLS-1$ | |
193 | ||
194 | // ------------------------------------------------------------------------ | |
195 | // Parsing constants | |
196 | // ------------------------------------------------------------------------ | |
197 | /** | |
198 | * Pattern to match the version. | |
199 | */ | |
200 | public final static Pattern VERSION_PATTERN = Pattern.compile("\\s*lttng\\s+version\\s+(\\d+\\.\\d+\\.\\d+).*"); //$NON-NLS-1$ | |
201 | /** | |
202 | * Pattern to match for error output | |
203 | */ | |
204 | public final static Pattern ERROR_PATTERN = Pattern.compile("\\s*Error\\:.*"); //$NON-NLS-1$ | |
205 | /** | |
206 | * Pattern to match for session information (lttng list) | |
207 | */ | |
208 | public final static Pattern SESSION_PATTERN = Pattern.compile("\\s+(\\d+)\\)\\s+(.*)\\s+\\((.*)\\)\\s+\\[(active|inactive)\\].*"); //$NON-NLS-1$ | |
209 | /** | |
210 | * Pattern to match for session information (lttng list <session>) | |
211 | */ | |
212 | public final static Pattern TRACE_SESSION_PATTERN = Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\].*"); //$NON-NLS-1$ | |
213 | /** | |
214 | * Pattern to match for session path information (lttng list <session>) | |
215 | */ | |
216 | public final static Pattern TRACE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(.*)"); //$NON-NLS-1$ | |
217 | /** | |
218 | * Pattern to match for kernel domain information (lttng list <session>) | |
219 | */ | |
220 | public final static Pattern DOMAIN_KERNEL_PATTERN = Pattern.compile("=== Domain: Kernel ==="); //$NON-NLS-1$ | |
221 | /** | |
222 | * Pattern to match for ust domain information (lttng list <session>) | |
223 | */ | |
224 | public final static Pattern DOMAIN_UST_GLOBAL_PATTERN = Pattern.compile("=== Domain: UST global ==="); //$NON-NLS-1$ | |
225 | /** | |
226 | * Pattern to match for channels section (lttng list <session>) | |
227 | */ | |
228 | public final static Pattern CHANNELS_SECTION_PATTERN = Pattern.compile("\\s*Channels\\:"); //$NON-NLS-1$ | |
229 | /** | |
230 | * Pattern to match for channel information (lttng list <session>) | |
231 | */ | |
232 | public final static Pattern CHANNEL_PATTERN = Pattern.compile("\\s*-\\s+(.*)\\:\\s+\\[(enabled|disabled)\\]"); //$NON-NLS-1$ | |
233 | /** | |
234 | * Pattern to match for events section information (lttng list <session>) | |
235 | */ | |
236 | public final static Pattern EVENT_SECTION_PATTERN = Pattern.compile("\\s*Events\\:"); //$NON-NLS-1$ | |
237 | /** | |
238 | * Pattern to match for event information (no enabled events) (lttng list <session>) | |
239 | */ | |
240 | // public final static String EVENT_NONE_PATTERN = "\\s+None"; //$NON-NLS-1$ | |
241 | /** | |
242 | * Pattern to match for event information (lttng list <session>) | |
243 | */ | |
244 | public final static Pattern EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\].*"); //$NON-NLS-1$ | |
245 | /** | |
246 | * Pattern to match a wildcarded event information (lttng list <session>) | |
247 | */ | |
248 | public final static Pattern WILDCARD_EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\].*"); //$NON-NLS-1$ | |
249 | /** | |
250 | * Pattern to match a probe address information (lttng list <session>) | |
251 | */ | |
252 | public final static Pattern PROBE_ADDRESS_PATTERN = Pattern.compile("\\s+(addr)\\:\\s+(0x[0-9a-fA-F]{1,8})"); //$NON-NLS-1$ | |
253 | /** | |
254 | * Pattern to match a probe OFFSET information (lttng list <session>) | |
255 | */ | |
256 | public final static Pattern PROBE_OFFSET_PATTERN = Pattern.compile("\\s+(offset)\\:\\s+(0x[0-9a-fA-F]{1,8})"); //$NON-NLS-1$ | |
257 | /** | |
258 | * Pattern to match a probe SYMBOL information (lttng list <session>) | |
259 | */ | |
260 | public final static Pattern PROBE_SYMBOL_PATTERN = Pattern.compile("\\s+(symbol)\\:\\s+(.+)"); //$NON-NLS-1$ | |
261 | /** | |
262 | * Pattern to match for channel (overwite mode) information (lttng list <session>) | |
263 | */ | |
264 | public final static Pattern OVERWRITE_MODE_ATTRIBUTE = Pattern.compile("\\s+overwrite\\s+mode\\:.*"); //$NON-NLS-1$ | |
265 | /** | |
266 | * Pattern to match indicating false for overwrite mode | |
267 | */ | |
268 | public final static String OVERWRITE_MODE_ATTRIBUTE_FALSE = "0"; //$NON-NLS-1$ | |
269 | /** | |
270 | * Pattern to match for channel (sub-buffer size) information (lttng list <session>) | |
271 | */ | |
272 | public final static Pattern SUBBUFFER_SIZE_ATTRIBUTE = Pattern.compile("\\s+subbufers\\s+size\\:.*"); //$NON-NLS-1$ | |
273 | /** | |
274 | * Pattern to match for channel (number of sub-buffers) information (lttng list <session>) | |
275 | */ | |
276 | public final static Pattern NUM_SUBBUFFERS_ATTRIBUTE = Pattern.compile("\\s+number\\s+of\\s+subbufers\\:.*"); //$NON-NLS-1$ | |
277 | /** | |
278 | * Pattern to match for channel (switch timer) information (lttng list <session>) | |
279 | */ | |
280 | public final static Pattern SWITCH_TIMER_ATTRIBUTE = Pattern.compile("\\s+switch\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$ | |
281 | /** | |
282 | * Pattern to match for channel (read timer) information (lttng list <session>) | |
283 | */ | |
284 | public final static Pattern READ_TIMER_ATTRIBUTE = Pattern.compile("\\s+read\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$ | |
285 | /** | |
286 | * Pattern to match for channel (output type) information (lttng list <session>) | |
287 | */ | |
288 | public final static Pattern OUTPUT_ATTRIBUTE = Pattern.compile("\\s+output\\:.*"); //$NON-NLS-1$ | |
289 | /** | |
290 | * Pattern to match for provider information (lttng list -k/-u) | |
291 | */ | |
292 | public final static Pattern PROVIDER_EVENT_PATTERN = Pattern.compile("\\s*(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)"); //$NON-NLS-1$ | |
293 | /** | |
294 | * Pattern to match for UST provider information (lttng list -u) | |
295 | */ | |
296 | public final static Pattern UST_PROVIDER_PATTERN = Pattern.compile("\\s*PID\\:\\s+(\\d+)\\s+-\\s+Name\\:\\s+(.*)"); //$NON-NLS-1$ | |
297 | /** | |
298 | * Pattern to match for session information (lttng create <session name>) | |
299 | */ | |
300 | public final static Pattern CREATE_SESSION_NAME_PATTERN = Pattern.compile("\\s*Session\\s+(.*)\\s+created\\."); //$NON-NLS-1$ | |
301 | /** | |
302 | * Pattern to match for session path information (lttng create <session name>) | |
303 | */ | |
304 | public final static Pattern CREATE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Traces\\s+will\\s+be\\s+written\\s+in\\s+(.*).*"); //$NON-NLS-1$ | |
305 | /** | |
306 | * Pattern to match for session command output for "session name not found". | |
307 | */ | |
308 | public final static Pattern SESSION_NOT_FOUND_ERROR_PATTERN = Pattern.compile("\\s*Error:\\s+Session\\s+name\\s+not\\s+found"); //$NON-NLS-1$ | |
309 | /** | |
310 | * Pattern to match introduction line of context list. | |
311 | */ | |
312 | public final static Pattern ADD_CONTEXT_HELP_CONTEXTS_INTRO = Pattern.compile("\\s*TYPE can\\s+be\\s+one\\s+of\\s+the\\s+strings\\s+below.*"); //$NON-NLS-1$ | |
313 | /** | |
314 | * Pattern to match introduction line of context list. | |
315 | */ | |
316 | public final static Pattern ADD_CONTEXT_HELP_CONTEXTS_END_LINE = Pattern.compile("\\s*Example.*"); //$NON-NLS-1$ | |
317 | ||
318 | } |