lttng: Add schema for LTTng MI 3.0 (LTTng 2.8)
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.control.ui / src / org / eclipse / tracecompass / internal / lttng2 / control / ui / views / service / LTTngControlServiceConstants.java
1 /**********************************************************************
2 * Copyright (c) 2012, 2016 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 * Simon Delisle - Updated for support of LTTng Tools 2.2
13 * Marc-Andre Laperle - Support for creating a live session
14 **********************************************************************/
15 package org.eclipse.tracecompass.internal.lttng2.control.ui.views.service;
16
17 import java.util.regex.Pattern;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20
21 /**
22 * <p>
23 * Constants for LTTng Control Service.
24 * </p>
25 *
26 * @author Bernd Hufmann
27 */
28 @NonNullByDefault
29 public interface LTTngControlServiceConstants {
30
31 // ------------------------------------------------------------------------
32 // Version constants
33 // ------------------------------------------------------------------------
34 /**
35 * Pattern to match the LTTng toolchain version 2.x.y.
36 */
37 Pattern VERSION_2_PATTERN = Pattern.compile("(2\\.\\d+\\.\\d+).*"); //$NON-NLS-1$
38
39 // ------------------------------------------------------------------------
40 // Constants
41 // ------------------------------------------------------------------------
42 /**
43 * Unused value
44 */
45 int UNUSED_VALUE = -1;
46 /**
47 * String representation of numerical true element
48 */
49 String TRUE_NUMERICAL = "1"; //$NON-NLS-1$
50
51 /** The default directory for session */
52 public static final String DEFAULT_PATH = ".lttng/sessions"; //$NON-NLS-1$
53
54 // ------------------------------------------------------------------------
55 // LTTng Machine Interface constants
56 // ------------------------------------------------------------------------
57
58 /**
59 * Name of the XSD to validate against the xml machine interface
60 * output from LTTng
61 */
62 String MI_XSD_FILENAME = "mi_lttng.xsd"; //$NON-NLS-1$
63 /**
64 * Name of the XSD to validate against the xml machine interface
65 * output from LTTng, version 3.0
66 */
67 String MI3_XSD_FILENAME = "mi-lttng-3.0.xsd"; //$NON-NLS-1$
68 // ------------------------------------------------------------------------
69 // Command constants
70 // ------------------------------------------------------------------------
71 /**
72 * The lttng tools command.
73 */
74 String CONTROL_COMMAND = "lttng"; //$NON-NLS-1$
75 /**
76 * The lttng tools machine interface command.
77 */
78 String CONTROL_COMMAND_MI_OPTION = "--mi"; //$NON-NLS-1$
79 /**
80 * The lttng tools XML machine interface command.
81 */
82 String CONTROL_COMMAND_MI_XML = "xml"; //$NON-NLS-1$
83 /**
84 * Command: lttng version.
85 */
86 String COMMAND_VERSION = "version"; //$NON-NLS-1$
87 /**
88 * Command: lttng list.
89 */
90 String COMMAND_LIST = "list"; //$NON-NLS-1$
91 /**
92 * Command to create a session.
93 */
94 String COMMAND_CREATE_SESSION = "create"; //$NON-NLS-1$
95 /**
96 * Command to destroy a session.
97 */
98 String COMMAND_DESTROY_SESSION = "destroy"; //$NON-NLS-1$
99 /**
100 * Command to destroy a session.
101 */
102 String COMMAND_START_SESSION = "start"; //$NON-NLS-1$
103 /**
104 * Command to destroy a session.
105 */
106 String COMMAND_STOP_SESSION = "stop"; //$NON-NLS-1$
107 /**
108 * Command to enable a channel.
109 */
110 String COMMAND_ENABLE_CHANNEL = "enable-channel"; //$NON-NLS-1$
111 /**
112 * Command to disable a channel.
113 */
114 String COMMAND_DISABLE_CHANNEL = "disable-channel"; //$NON-NLS-1$
115 /**
116 * Command to enable a event.
117 */
118 String COMMAND_ENABLE_EVENT = "enable-event"; //$NON-NLS-1$
119 /**
120 * Command to disable a event.
121 */
122 String COMMAND_DISABLE_EVENT = "disable-event"; //$NON-NLS-1$
123 /**
124 * Command to add a context to channels and/or events
125 */
126 String COMMAND_ADD_CONTEXT = "add-context"; //$NON-NLS-1$
127 /**
128 * Command to execute sub-command snapshot
129 */
130 String COMMAND_SNAPSHOT = "snapshot"; //$NON-NLS-1$
131 /**
132 * Command to list the snapshot outputs
133 */
134 String COMMAND_LIST_SNAPSHOT_OUTPUT = "list-output"; //$NON-NLS-1$
135 /**
136 * Command to record a snapshot
137 */
138 String COMMAND_RECORD_SNAPSHOT = "record"; //$NON-NLS-1$
139 /**
140 * Command to load a session.
141 */
142 String COMMAND_LOAD_SESSION = "load"; //$NON-NLS-1$
143 /**
144 * Command to save a session
145 */
146 String COMMAND_SAVE_SESSION = "save"; //$NON-NLS-1$
147
148 // ------------------------------------------------------------------------
149 // Command line options constants
150 // ------------------------------------------------------------------------
151 /**
152 * Command line option to add tracing group of user.
153 */
154 String OPTION_TRACING_GROUP = "-g"; //$NON-NLS-1$
155 /**
156 * Command line option for verbose output.
157 */
158 String OPTION_VERBOSE = "-v"; //$NON-NLS-1$
159 /**
160 * Command line option for verbose output.
161 */
162 String OPTION_VERY_VERBOSE = "-vv"; //$NON-NLS-1$
163 /**
164 * Command line option for verbose output.
165 */
166 String OPTION_VERY_VERY_VERBOSE = "-vvv"; //$NON-NLS-1$
167 /**
168 * Command line option for output path.
169 */
170 String OPTION_OUTPUT_PATH = "-o"; //$NON-NLS-1$
171 /**
172 * Command line option for output path.
173 */
174 String OPTION_SNAPSHOT = "--snapshot"; //$NON-NLS-1$
175 /**
176 * Command line option for live
177 */
178 String OPTION_LIVE = "--live"; //$NON-NLS-1$
179 /**
180 * Command line option for kernel tracer.
181 */
182 String OPTION_KERNEL = "-k"; //$NON-NLS-1$
183 /**
184 * Command line option for UST tracer.
185 */
186 String OPTION_UST = "-u"; //$NON-NLS-1$
187 /**
188 * Command line option for specifying a session.
189 */
190 String OPTION_SESSION = "-s"; //$NON-NLS-1$
191 /**
192 * Command line option for specifying a channel.
193 */
194 String OPTION_CHANNEL = "-c"; //$NON-NLS-1$
195 /**
196 * Command line option for specifying a event.
197 */
198 String OPTION_EVENT = "-e"; //$NON-NLS-1$
199 /**
200 * Command line option for specifying all events.
201 */
202 String OPTION_ALL = "-a"; //$NON-NLS-1$
203 /**
204 * Command line option for specifying a context.
205 */
206 String OPTION_CONTEXT_TYPE = "-t"; //$NON-NLS-1$
207 /**
208 * Command line option for specifying tracepoint events.
209 */
210 String OPTION_TRACEPOINT = "--tracepoint"; //$NON-NLS-1$
211 /**
212 * Command line option for specifying syscall events.
213 */
214 String OPTION_SYSCALL = "--syscall"; //$NON-NLS-1$
215 /**
216 * Command line option for specifying a dynamic probe.
217 */
218 String OPTION_PROBE = "--probe"; //$NON-NLS-1$
219 /**
220 * Command line option for specifying a dynamic function entry/return probe.
221 */
222 String OPTION_FUNCTION_PROBE = "--function"; //$NON-NLS-1$
223 /**
224 * Command line option for specifying a log level range.
225 */
226 String OPTION_LOGLEVEL = "--loglevel"; //$NON-NLS-1$
227 /**
228 * Command line option for specifying a specific log level.
229 */
230 String OPTION_LOGLEVEL_ONLY = "--loglevel-only"; //$NON-NLS-1$
231 /**
232 * Optional command line option for configuring a channel's overwrite mode.
233 */
234 String OPTION_OVERWRITE = "--overwrite"; //$NON-NLS-1$
235 /**
236 * Optional command line option for configuring a channel's number of sub buffers.
237 */
238 String OPTION_NUM_SUB_BUFFERS = "--num-subbuf"; //$NON-NLS-1$
239 /**
240 * Optional command line option for configuring a channel's sub buffer size.
241 */
242 String OPTION_SUB_BUFFER_SIZE = "--subbuf-size"; //$NON-NLS-1$
243 /**
244 * Optional command line option for configuring a channel's switch timer interval.
245 */
246 String OPTION_SWITCH_TIMER = "--switch-timer"; //$NON-NLS-1$
247 /**
248 * Optional command line option for configuring a channel's read timer interval.
249 */
250 String OPTION_READ_TIMER = "--read-timer"; //$NON-NLS-1$
251 /**
252 * Command line option for printing the help of a specific command
253 */
254 String OPTION_HELP = "-h"; //$NON-NLS-1$
255 /**
256 * Command line option for listing things. For example listing available
257 * context.
258 */
259 String OPTION_LIST = "--list"; //$NON-NLS-1$
260 /**
261 * Command line option for listing the fields of UST tracepoints
262 */
263 String OPTION_FIELDS = "-f"; //$NON-NLS-1$
264 /**
265 * Command line option for configuring event's filter
266 */
267 String OPTION_FILTER = "--filter"; //$NON-NLS-1$
268 /**
269 * Command line option for configuring the streaming network URL (common for control and data channel).
270 */
271 String OPTION_NETWORK_URL = "-U"; //$NON-NLS-1$
272 /**
273 * Command line option for configuring the streaming control URL.
274 */
275 String OPTION_CONTROL_URL = "-C"; //$NON-NLS-1$
276 /**
277 * Command line option for configuring the streaming data URL.
278 */
279 String OPTION_DATA_URL = "-D"; //$NON-NLS-1$
280 /**
281 * Command line option for per UID buffers
282 */
283 String OPTION_PER_UID_BUFFERS = "--buffers-uid"; //$NON-NLS-1$
284 /**
285 * Command line option for per PID buffers
286 */
287 String OPTION_PER_PID_BUFFERS = "--buffers-pid"; //$NON-NLS-1$
288 /**
289 * Command line option for maximum size of trace files
290 */
291 String OPTION_MAX_SIZE_TRACE_FILES = "-C"; //$NON-NLS-1$
292 /**
293 * Command line option for maximum trace files
294 */
295 String OPTION_MAX_TRACE_FILES = "-W"; //$NON-NLS-1$
296 /**
297 * Command line option for force overwrite
298 */
299 String OPTION_FORCE = "-f"; //$NON-NLS-1$
300 /**
301 * Command line option for specifying input path
302 */
303 String OPTION_INPUT_PATH = "-i"; //$NON-NLS-1$
304 /**
305 * Maximum live timer interval value
306 */
307 Long MAX_LIVE_TIMER_INTERVAL = 0xFFFFFFFEL;
308
309 // ------------------------------------------------------------------------
310 // Parsing constants
311 // ------------------------------------------------------------------------
312 /**
313 * Pattern to match the version.
314 */
315 Pattern VERSION_PATTERN = Pattern.compile(".*lttng\\s+version\\s+.*(\\d+\\.\\d+\\.\\d+).*"); //$NON-NLS-1$
316 /**
317 * Pattern to match for error output
318 */
319 Pattern ERROR_PATTERN = Pattern.compile("\\s*Error\\:.*"); //$NON-NLS-1$
320 /**
321 * Pattern to match for session information (lttng list)
322 */
323 Pattern SESSION_PATTERN = Pattern.compile("\\s+(\\d+)\\)\\s+(.*)\\s+\\((.*)\\)\\s+\\[(active|inactive).*\\].*"); //$NON-NLS-1$
324 /**
325 * Pattern to match for session information (lttng list <session>)
326 */
327 Pattern TRACE_SESSION_PATTERN = Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\].*"); //$NON-NLS-1$
328 /**
329 * Pattern to match for snapshot session information (lttng list <session>)
330 */
331 Pattern TRACE_SNAPSHOT_SESSION_PATTERN = Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\s*snapshot\\].*"); //$NON-NLS-1$
332 /**
333 * Pattern to match for session path information (lttng list <session>)
334 */
335 Pattern TRACE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(.*)"); //$NON-NLS-1$
336 /**
337 * Pattern to match session path for network tracing (lttng list <session>)
338 * Note: file for protocol is not considered as network trace since local consumer will be used.
339 */
340 Pattern TRACE_NETWORK_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$
341 /**
342 * Pattern to match session path for network tracing
343 * Note: file for protocol is not considered as network trace since local consumer will be used.
344 */
345 Pattern TRACE_NETWORK_PATTERN = Pattern.compile("\\s*(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$
346 /**
347 * Sub-pattern to pattern TRACE_NETWORK_PATH_PATTERN to match file protocol
348 */
349 Pattern TRACE_FILE_PROTOCOL_PATTERN = Pattern.compile("(file)\\:\\/\\/(.*)"); //$NON-NLS-1$
350 /**
351 * Pattern to match for kernel domain information (lttng list <session>)
352 */
353 Pattern DOMAIN_KERNEL_PATTERN = Pattern.compile("=== Domain: Kernel ==="); //$NON-NLS-1$
354 /**
355 * Pattern to match for ust domain information (lttng list <session>)
356 */
357 Pattern DOMAIN_UST_GLOBAL_PATTERN = Pattern.compile("=== Domain: UST global ==="); //$NON-NLS-1$
358 /**
359 * Pattern to match for matching warning about no kernel channel
360 */
361 Pattern DOMAIN_NO_KERNEL_CHANNEL_PATTERN = Pattern.compile("\\s*Warning\\:\\s+No kernel\\s+channel.*"); //$NON-NLS-1$
362 /**
363 * Pattern to match for matching warning about no UST channel
364 */
365 Pattern DOMAIN_NO_UST_CHANNEL_PATTERN = Pattern.compile("\\s*Error\\:\\s+UST\\s+channel\\s+not\\s+found.*"); //$NON-NLS-1$
366 /**
367 * Pattern to match for buffer type (lttng list <session>)
368 */
369 Pattern BUFFER_TYPE_PATTERN = Pattern.compile("\\s*Buffer\\s+type\\:.*"); //$NON-NLS-1$
370 /**
371 * Pattern to match for channels section (lttng list <session>)
372 */
373 Pattern CHANNELS_SECTION_PATTERN = Pattern.compile("\\s*Channels\\:"); //$NON-NLS-1$
374 /**
375 * Pattern to match for channel information (lttng list <session>)
376 */
377 Pattern CHANNEL_PATTERN = Pattern.compile("\\s*-\\s+(.*)\\:\\s+\\[(enabled|disabled)\\]"); //$NON-NLS-1$
378 /**
379 * Pattern to match for events section information (lttng list <session>)
380 */
381 Pattern EVENT_SECTION_PATTERN = Pattern.compile("\\s*Events\\:"); //$NON-NLS-1$
382 /**
383 * Pattern to match for event information (lttng list <session>)
384 */
385 Pattern EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(loglevel\\s*(:|<=|==)\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$
386 /**
387 * Pattern to match a wildcarded event information (lttng list <session>)
388 */
389 Pattern WILDCARD_EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$
390 /**
391 * Pattern to match a probe address information (lttng list <session>)
392 */
393 Pattern PROBE_ADDRESS_PATTERN = Pattern.compile("\\s+(addr)\\:\\s+(0x[0-9a-fA-F]{1,16})"); //$NON-NLS-1$
394 /**
395 * Pattern to match a probe OFFSET information (lttng list <session>)
396 */
397 Pattern PROBE_OFFSET_PATTERN = Pattern.compile("\\s+(offset)\\:\\s+(0x[0-9a-fA-F]{1,16})"); //$NON-NLS-1$
398 /**
399 * Pattern to match a probe SYMBOL information (lttng list <session>)
400 */
401 Pattern PROBE_SYMBOL_PATTERN = Pattern.compile("\\s+(symbol)\\:\\s+(.+)"); //$NON-NLS-1$
402 /**
403 * Pattern to match for channel (overwite mode) information (lttng list <session>)
404 */
405 Pattern OVERWRITE_MODE_ATTRIBUTE = Pattern.compile("\\s+overwrite\\s+mode\\:.*"); //$NON-NLS-1$
406 /**
407 * Pattern to match indicating false for overwrite mode
408 */
409 String OVERWRITE_MODE_ATTRIBUTE_FALSE = "0"; //$NON-NLS-1$
410 /**
411 * Pattern to match indicating false for overwrite mode in machine interface mode
412 */
413 String OVERWRITE_MODE_ATTRIBUTE_FALSE_MI = "DISCARD"; //$NON-NLS-1$
414 /**
415 * Pattern to match for channel (sub-buffer size) information (lttng list <session>)
416 */
417 Pattern SUBBUFFER_SIZE_ATTRIBUTE = Pattern.compile("\\s+subbufers\\s+size\\:.*"); //$NON-NLS-1$
418 /**
419 * Pattern to match for channel (number of sub-buffers) information (lttng list <session>)
420 */
421 Pattern NUM_SUBBUFFERS_ATTRIBUTE = Pattern.compile("\\s+number\\s+of\\s+subbufers\\:.*"); //$NON-NLS-1$
422 /**
423 * Pattern to match for channel (switch timer) information (lttng list <session>)
424 */
425 Pattern SWITCH_TIMER_ATTRIBUTE = Pattern.compile("\\s+switch\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$
426 /**
427 * Pattern to match for channel (read timer) information (lttng list <session>)
428 */
429 Pattern READ_TIMER_ATTRIBUTE = Pattern.compile("\\s+read\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$
430 /**
431 * Pattern to match for channel (output type) information (lttng list <session>)
432 */
433 Pattern OUTPUT_ATTRIBUTE = Pattern.compile("\\s+output\\:.*"); //$NON-NLS-1$
434 /**
435 * Pattern to match for channel (trace file size) information (lttng list <session>)
436 */
437 Pattern TRACE_FILE_COUNT_ATTRIBUTE = Pattern.compile("\\s+trace\\s+file\\s+count\\:.*"); //$NON-NLS-1$
438 /**
439 * Pattern to match for channel (trace file size) information (lttng list <session>)
440 */
441 Pattern TRACE_FILE_SIZE_ATTRIBUTE = Pattern.compile("\\s+trace\\s+file\\s+size\\s+\\(bytes\\)\\:.*"); //$NON-NLS-1$
442 /**
443 * Pattern to match for provider information (lttng list -k/-u)
444 */
445 Pattern PROVIDER_EVENT_PATTERN = Pattern.compile("\\s*(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)"); //$NON-NLS-1$
446 /**
447 * Pattern to match event fields
448 */
449 Pattern EVENT_FIELD_PATTERN = Pattern.compile("\\s*(field:)\\s+(.*)\\s+\\((.*)\\)"); //$NON-NLS-1$
450 /**
451 * Pattern to match for UST provider information (lttng list -u)
452 */
453 Pattern UST_PROVIDER_PATTERN = Pattern.compile("\\s*PID\\:\\s+(\\d+)\\s+-\\s+Name\\:\\s+(.*)"); //$NON-NLS-1$
454 /**
455 * Pattern to match for session information (lttng create <session name>)
456 */
457 Pattern CREATE_SESSION_NAME_PATTERN = Pattern.compile(".*Session\\s+(.*)\\s+created\\."); //$NON-NLS-1$
458 /**
459 * Pattern to match for session path information (lttng create <session name>)
460 */
461 Pattern CREATE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Traces\\s+will\\s+be\\s+written\\s+in\\s+(.*).*"); //$NON-NLS-1$
462 /**
463 * Pattern to match for session command output for "session name not found".
464 */
465 Pattern SESSION_NOT_FOUND_ERROR_PATTERN = Pattern.compile("\\s*Error:\\s+Session\\s+name\\s.*not\\s+found"); //$NON-NLS-1$
466 /**
467 * Pattern to match introduction line of context list.
468 */
469 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$
470 /**
471 * Pattern to match introduction line of context list.
472 */
473 Pattern ADD_CONTEXT_HELP_CONTEXTS_END_LINE = Pattern.compile("\\s*Example.*"); //$NON-NLS-1$
474 /**
475 * Pattern to match error line if no kernel tracer is available or installed.
476 */
477 Pattern LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN = Pattern.compile("\\s*Error:\\s+Unable\\s+to\\s+list\\s+kernel\\s+events.*"); //$NON-NLS-1$;
478 /**
479 * Pattern to match error line if no ust tracer is available or installed.
480 */
481 Pattern LIST_UST_NO_UST_PROVIDER_PATTERN = Pattern.compile(".*Unable\\s*to\\s*list\\s*UST\\s*event.*"); //$NON-NLS-1$;
482 /**
483 * Pattern to match for list snapshot information (lttng snapshot list-output)
484 */
485 Pattern LIST_SNAPSHOT_OUTPUT_PATTERN = Pattern.compile("\\s+\\[(\\d+)\\]\\s+(\\S*)\\:\\s+(\\S*)(.*)"); //$NON-NLS-1$
486 /**
487 * Pattern to match the live timer interval line of session list.
488 */
489 Pattern LIST_LIVE_TIMER_INTERVAL_PATTERN = Pattern.compile("\\s*Live\\stimer\\sinterval\\s\\(usec\\):\\s(\\d+)"); //$NON-NLS-1$
490 /**
491 * Pattern to match snapshot path for network tracing (lttng list <session>)
492 * Note: file for protocol is not considered as network trace since local consumer will be used.
493 */
494 Pattern SNAPSHOT_NETWORK_PATH_PATTERN = Pattern.compile("(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$
495
496 }
This page took 0.045407 seconds and 5 git commands to generate.