lttng: Fix more Sonar warnings in LTTng Tracer Control
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / service / LTTngControlServiceConstants.java
CommitLineData
276c17e7 1/**********************************************************************
ba3a9bd2 2 * Copyright (c) 2012, 2013 Ericsson
cfdb727a 3 *
276c17e7
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:
276c17e7 10 * Bernd Hufmann - Initial API and implementation
ba3a9bd2 11 * Bernd Hufmann - Updated for support of LTTng Tools 2.1
276c17e7
BH
12 **********************************************************************/
13package org.eclipse.linuxtools.internal.lttng2.ui.views.control.service;
14
15import java.util.regex.Pattern;
16
17/**
276c17e7
BH
18 * <p>
19 * Constants for LTTng Control Service.
20 * </p>
cfdb727a 21 *
dbd4432d 22 * @author Bernd Hufmann
276c17e7 23 */
046b6849 24public interface LTTngControlServiceConstants {
276c17e7
BH
25
26 // ------------------------------------------------------------------------
27 // Version constants
28 // ------------------------------------------------------------------------
cfdb727a 29 /**
cfe737e4 30 * Pattern to match the LTTng toolchain version 2.x.y.
cfdb727a 31 */
046b6849 32 static final Pattern VERSION_2_PATTERN = Pattern.compile("(2\\.\\d+\\.\\d+).*"); //$NON-NLS-1$
276c17e7
BH
33
34 // ------------------------------------------------------------------------
35 // Command constants
36 // ------------------------------------------------------------------------
37 /**
38 * The lttng tools command.
39 */
046b6849 40 static final String CONTROL_COMMAND = "lttng"; //$NON-NLS-1$
276c17e7
BH
41 /**
42 * Command: lttng version.
43 */
046b6849 44 static final String COMMAND_VERSION = " version "; //$NON-NLS-1$
276c17e7
BH
45 /**
46 * Command: lttng list.
47 */
046b6849 48 static final String COMMAND_LIST = " list "; //$NON-NLS-1$
276c17e7
BH
49 /**
50 * Command to list kernel tracer information.
51 */
046b6849 52 static final String COMMAND_LIST_KERNEL = COMMAND_LIST + "-k"; //$NON-NLS-1$
276c17e7
BH
53 /**
54 * Command to list user space trace information.
55 */
046b6849 56 static final String COMMAND_LIST_UST = COMMAND_LIST + "-u"; //$NON-NLS-1$
276c17e7 57 /**
cfdb727a 58 * Command to create a session.
276c17e7 59 */
046b6849 60 static final String COMMAND_CREATE_SESSION = " create "; //$NON-NLS-1$
276c17e7 61 /**
cfdb727a 62 * Command to destroy a session.
276c17e7 63 */
046b6849 64 static final String COMMAND_DESTROY_SESSION = " destroy "; //$NON-NLS-1$
276c17e7 65 /**
cfdb727a 66 * Command to destroy a session.
276c17e7 67 */
046b6849 68 static final String COMMAND_START_SESSION = " start "; //$NON-NLS-1$
276c17e7 69 /**
cfdb727a 70 * Command to destroy a session.
276c17e7 71 */
046b6849 72 static final String COMMAND_STOP_SESSION = " stop "; //$NON-NLS-1$
276c17e7 73 /**
cfdb727a 74 * Command to enable a channel.
276c17e7 75 */
046b6849 76 static final String COMMAND_ENABLE_CHANNEL = " enable-channel "; //$NON-NLS-1$
276c17e7 77 /**
cfdb727a 78 * Command to disable a channel.
276c17e7 79 */
046b6849 80 static final String COMMAND_DISABLE_CHANNEL = " disable-channel "; //$NON-NLS-1$
276c17e7 81 /**
cfdb727a 82 * Command to enable a event.
276c17e7 83 */
046b6849 84 static final String COMMAND_ENABLE_EVENT = " enable-event "; //$NON-NLS-1$
276c17e7 85 /**
cfdb727a 86 * Command to disable a event.
276c17e7 87 */
046b6849 88 static final String COMMAND_DISABLE_EVENT = " disable-event "; //$NON-NLS-1$
276c17e7
BH
89 /**
90 * Command to add a context to channels and/or events
91 */
046b6849 92 static final String COMMAND_ADD_CONTEXT = " add-context "; //$NON-NLS-1$
276c17e7
BH
93 /**
94 * Command to execute calibrate command to quantify LTTng overhead
95 */
046b6849 96 static final String COMMAND_CALIBRATE = " calibrate "; //$NON-NLS-1$
276c17e7
BH
97
98 // ------------------------------------------------------------------------
99 // Command line options constants
100 // ------------------------------------------------------------------------
101 /**
102 * Command line option to add tracing group of user.
103 */
046b6849 104 static final String OPTION_TRACING_GROUP = " -g "; //$NON-NLS-1$
276c17e7
BH
105 /**
106 * Command line option for verbose output.
107 */
046b6849 108 static final String OPTION_VERBOSE = " -v "; //$NON-NLS-1$
276c17e7
BH
109 /**
110 * Command line option for verbose output.
111 */
046b6849 112 static final String OPTION_VERY_VERBOSE = " -vv "; //$NON-NLS-1$
276c17e7
BH
113 /**
114 * Command line option for verbose output.
115 */
046b6849 116 static final String OPTION_VERY_VERY_VERBOSE = " -vvv "; //$NON-NLS-1$
276c17e7
BH
117 /**
118 * Command line option for output path.
119 */
046b6849 120 static final String OPTION_OUTPUT_PATH = " -o "; //$NON-NLS-1$
276c17e7
BH
121 /**
122 * Command line option for kernel tracer.
123 */
046b6849 124 static final String OPTION_KERNEL = " -k "; //$NON-NLS-1$
276c17e7
BH
125 /**
126 * Command line option for UST tracer.
127 */
046b6849 128 static final String OPTION_UST = " -u "; //$NON-NLS-1$
276c17e7
BH
129 /**
130 * Command line option for specifying a session.
131 */
046b6849 132 static final String OPTION_SESSION = " -s "; //$NON-NLS-1$
276c17e7
BH
133 /**
134 * Command line option for specifying a channel.
135 */
046b6849 136 static final String OPTION_CHANNEL = " -c "; //$NON-NLS-1$
276c17e7
BH
137 /**
138 * Command line option for specifying a event.
139 */
046b6849 140 static final String OPTION_EVENT = " -e "; //$NON-NLS-1$
276c17e7
BH
141 /**
142 * Command line option for specifying all events.
143 */
046b6849 144 static final String OPTION_ALL = " -a "; //$NON-NLS-1$
276c17e7
BH
145 /**
146 * Command line option for specifying a context.
147 */
046b6849 148 static final String OPTION_CONTEXT_TYPE = " -t "; //$NON-NLS-1$
276c17e7
BH
149 /**
150 * Command line option for specifying tracepoint events.
151 */
046b6849 152 static final String OPTION_TRACEPOINT = " --tracepoint "; //$NON-NLS-1$
276c17e7
BH
153 /**
154 * Command line option for specifying syscall events.
155 */
046b6849 156 static final String OPTION_SYSCALL = " --syscall "; //$NON-NLS-1$
276c17e7
BH
157 /**
158 * Command line option for specifying a dynamic probe.
159 */
046b6849 160 static final String OPTION_PROBE = " --probe "; //$NON-NLS-1$
276c17e7
BH
161 /**
162 * Command line option for specifying a dynamic function entry/return probe.
163 */
046b6849 164 static final String OPTION_FUNCTION_PROBE = " --function "; //$NON-NLS-1$
276c17e7
BH
165 /**
166 * Command line option for specifying a log level range.
167 */
046b6849 168 static final String OPTION_LOGLEVEL = " --loglevel "; //$NON-NLS-1$
276c17e7
BH
169 /**
170 * Command line option for specifying a specific log level.
171 */
046b6849 172 static final String OPTION_LOGLEVEL_ONLY = " --loglevel-only "; //$NON-NLS-1$
276c17e7
BH
173 /**
174 * Optional command line option for configuring a channel's overwrite mode.
175 */
046b6849 176 static final String OPTION_OVERWRITE = " --overwrite "; //$NON-NLS-1$
276c17e7
BH
177 /**
178 * Optional command line option for configuring a channel's number of sub buffers.
179 */
046b6849 180 static final String OPTION_NUM_SUB_BUFFERS = " --num-subbuf "; //$NON-NLS-1$
276c17e7
BH
181 /**
182 * Optional command line option for configuring a channel's sub buffer size.
183 */
046b6849 184 static final String OPTION_SUB_BUFFER_SIZE = " --subbuf-size "; //$NON-NLS-1$
276c17e7
BH
185 /**
186 * Optional command line option for configuring a channel's switch timer interval.
187 */
046b6849 188 static final String OPTION_SWITCH_TIMER = " --switch-timer "; //$NON-NLS-1$
276c17e7
BH
189 /**
190 * Optional command line option for configuring a channel's read timer interval.
191 */
046b6849 192 static final String OPTION_READ_TIMER = " --read-timer "; //$NON-NLS-1$
276c17e7 193 /**
cfdb727a 194 * Command line option for printing the help of a specif command
276c17e7 195 */
046b6849 196 static final String OPTION_HELP = " -h "; //$NON-NLS-1$
d4514365
BH
197 /**
198 * Command line option for listing the fields of UST tracepoints
199 */
046b6849 200 static final String OPTION_FIELDS = " -f "; //$NON-NLS-1$
d4514365
BH
201 /**
202 * Command line option for configuring event's filter
203 */
046b6849 204 static final String OPTION_FILTER = " --filter "; //$NON-NLS-1$
f3b33d40
BH
205 /**
206 * Command line option for configuring the streaming network URL (common for control and data channel).
207 */
046b6849 208 static final String OPTION_NETWORK_URL = " -U "; //$NON-NLS-1$
f3b33d40
BH
209 /**
210 * Command line option for configuring the streaming control URL.
211 */
046b6849 212 static final String OPTION_CONTROL_URL = " -C "; //$NON-NLS-1$
f3b33d40
BH
213 /**
214 * Command line option for configuring the streaming data URL.
215 */
046b6849 216 static final String OPTION_DATA_URL = " -D "; //$NON-NLS-1$
276c17e7
BH
217
218 // ------------------------------------------------------------------------
219 // Parsing constants
220 // ------------------------------------------------------------------------
221 /**
222 * Pattern to match the version.
223 */
046b6849 224 static final Pattern VERSION_PATTERN = Pattern.compile(".*lttng\\s+version\\s+(\\d+\\.\\d+\\.\\d+).*"); //$NON-NLS-1$
276c17e7
BH
225 /**
226 * Pattern to match for error output
227 */
046b6849 228 static final Pattern ERROR_PATTERN = Pattern.compile("\\s*Error\\:.*"); //$NON-NLS-1$
276c17e7
BH
229 /**
230 * Pattern to match for session information (lttng list)
231 */
046b6849 232 static final Pattern SESSION_PATTERN = Pattern.compile("\\s+(\\d+)\\)\\s+(.*)\\s+\\((.*)\\)\\s+\\[(active|inactive)\\].*"); //$NON-NLS-1$
276c17e7
BH
233 /**
234 * Pattern to match for session information (lttng list <session>)
235 */
046b6849 236 static final Pattern TRACE_SESSION_PATTERN = Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\].*"); //$NON-NLS-1$
276c17e7
BH
237 /**
238 * Pattern to match for session path information (lttng list <session>)
239 */
046b6849 240 static final Pattern TRACE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(.*)"); //$NON-NLS-1$
f3b33d40 241 /**
a30e79fe
BH
242 * Pattern to match session path for network tracing (lttng list <session>)
243 * Note: file for protocol is not considered as network trace since local consumer will be used.
f3b33d40 244 */
046b6849 245 static final Pattern TRACE_NETWORK_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(net|net6|tcp|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$
d128c979
BH
246 /**
247 * Sub-pattern to pattern TRACE_NETWORK_PATH_PATTERN to match file protocol
248 */
046b6849 249 static final Pattern TRACE_FILE_PROTOCOL_PATTERN = Pattern.compile("(file)\\:\\/\\/(.*)"); //$NON-NLS-1$
276c17e7
BH
250 /**
251 * Pattern to match for kernel domain information (lttng list <session>)
252 */
046b6849 253 static final Pattern DOMAIN_KERNEL_PATTERN = Pattern.compile("=== Domain: Kernel ==="); //$NON-NLS-1$
276c17e7
BH
254 /**
255 * Pattern to match for ust domain information (lttng list <session>)
256 */
046b6849 257 static final Pattern DOMAIN_UST_GLOBAL_PATTERN = Pattern.compile("=== Domain: UST global ==="); //$NON-NLS-1$
a30e79fe
BH
258 /**
259 * Pattern to match for matching warning about no kernel channel
260 */
046b6849 261 static final Pattern DOMAIN_NO_KERNEL_CHANNEL_PATTERN = Pattern.compile("\\s*Warning\\:\\s+No kernel\\s+channel.*"); //$NON-NLS-1$
a30e79fe
BH
262 /**
263 * Pattern to match for matching warning about no UST channel
264 */
046b6849 265 static final Pattern DOMAIN_NO_UST_CHANNEL_PATTERN = Pattern.compile("\\s*Error\\:\\s+UST\\s+channel\\s+not\\s+found.*"); //$NON-NLS-1$
276c17e7
BH
266 /**
267 * Pattern to match for channels section (lttng list <session>)
268 */
046b6849 269 static final Pattern CHANNELS_SECTION_PATTERN = Pattern.compile("\\s*Channels\\:"); //$NON-NLS-1$
276c17e7
BH
270 /**
271 * Pattern to match for channel information (lttng list <session>)
272 */
046b6849 273 static final Pattern CHANNEL_PATTERN = Pattern.compile("\\s*-\\s+(.*)\\:\\s+\\[(enabled|disabled)\\]"); //$NON-NLS-1$
276c17e7
BH
274 /**
275 * Pattern to match for events section information (lttng list <session>)
276 */
046b6849 277 static final Pattern EVENT_SECTION_PATTERN = Pattern.compile("\\s*Events\\:"); //$NON-NLS-1$
276c17e7
BH
278 /**
279 * Pattern to match for event information (lttng list <session>)
280 */
046b6849 281 static final Pattern EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$
276c17e7
BH
282 /**
283 * Pattern to match a wildcarded event information (lttng list <session>)
284 */
046b6849 285 static final Pattern WILDCARD_EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$
276c17e7
BH
286 /**
287 * Pattern to match a probe address information (lttng list <session>)
288 */
046b6849 289 static final Pattern PROBE_ADDRESS_PATTERN = Pattern.compile("\\s+(addr)\\:\\s+(0x[0-9a-fA-F]{1,8})"); //$NON-NLS-1$
276c17e7
BH
290 /**
291 * Pattern to match a probe OFFSET information (lttng list <session>)
292 */
046b6849 293 static final Pattern PROBE_OFFSET_PATTERN = Pattern.compile("\\s+(offset)\\:\\s+(0x[0-9a-fA-F]{1,8})"); //$NON-NLS-1$
276c17e7
BH
294 /**
295 * Pattern to match a probe SYMBOL information (lttng list <session>)
296 */
046b6849 297 static final Pattern PROBE_SYMBOL_PATTERN = Pattern.compile("\\s+(symbol)\\:\\s+(.+)"); //$NON-NLS-1$
276c17e7
BH
298 /**
299 * Pattern to match for channel (overwite mode) information (lttng list <session>)
300 */
046b6849 301 static final Pattern OVERWRITE_MODE_ATTRIBUTE = Pattern.compile("\\s+overwrite\\s+mode\\:.*"); //$NON-NLS-1$
276c17e7
BH
302 /**
303 * Pattern to match indicating false for overwrite mode
304 */
046b6849 305 static final String OVERWRITE_MODE_ATTRIBUTE_FALSE = "0"; //$NON-NLS-1$
276c17e7
BH
306 /**
307 * Pattern to match for channel (sub-buffer size) information (lttng list <session>)
308 */
046b6849 309 static final Pattern SUBBUFFER_SIZE_ATTRIBUTE = Pattern.compile("\\s+subbufers\\s+size\\:.*"); //$NON-NLS-1$
276c17e7
BH
310 /**
311 * Pattern to match for channel (number of sub-buffers) information (lttng list <session>)
312 */
046b6849 313 static final Pattern NUM_SUBBUFFERS_ATTRIBUTE = Pattern.compile("\\s+number\\s+of\\s+subbufers\\:.*"); //$NON-NLS-1$
276c17e7
BH
314 /**
315 * Pattern to match for channel (switch timer) information (lttng list <session>)
316 */
046b6849 317 static final Pattern SWITCH_TIMER_ATTRIBUTE = Pattern.compile("\\s+switch\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$
276c17e7
BH
318 /**
319 * Pattern to match for channel (read timer) information (lttng list <session>)
320 */
046b6849 321 static final Pattern READ_TIMER_ATTRIBUTE = Pattern.compile("\\s+read\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$
276c17e7
BH
322 /**
323 * Pattern to match for channel (output type) information (lttng list <session>)
324 */
046b6849 325 static final Pattern OUTPUT_ATTRIBUTE = Pattern.compile("\\s+output\\:.*"); //$NON-NLS-1$
276c17e7
BH
326 /**
327 * Pattern to match for provider information (lttng list -k/-u)
328 */
046b6849 329 static final Pattern PROVIDER_EVENT_PATTERN = Pattern.compile("\\s*(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)"); //$NON-NLS-1$
d4514365
BH
330 /**
331 * Pattern to match event fields
332 */
046b6849 333 static final Pattern EVENT_FIELD_PATTERN = Pattern.compile("\\s*(field:)\\s+(.*)\\s+\\((.*)\\)"); //$NON-NLS-1$
276c17e7
BH
334 /**
335 * Pattern to match for UST provider information (lttng list -u)
336 */
046b6849 337 static final Pattern UST_PROVIDER_PATTERN = Pattern.compile("\\s*PID\\:\\s+(\\d+)\\s+-\\s+Name\\:\\s+(.*)"); //$NON-NLS-1$
276c17e7
BH
338 /**
339 * Pattern to match for session information (lttng create <session name>)
340 */
046b6849 341 static final Pattern CREATE_SESSION_NAME_PATTERN = Pattern.compile(".*Session\\s+(.*)\\s+created\\."); //$NON-NLS-1$
276c17e7
BH
342 /**
343 * Pattern to match for session path information (lttng create <session name>)
344 */
046b6849 345 static final Pattern CREATE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Traces\\s+will\\s+be\\s+written\\s+in\\s+(.*).*"); //$NON-NLS-1$
276c17e7
BH
346 /**
347 * Pattern to match for session command output for "session name not found".
348 */
046b6849 349 static final Pattern SESSION_NOT_FOUND_ERROR_PATTERN = Pattern.compile("\\s*Error:\\s+Session\\s+name\\s+not\\s+found"); //$NON-NLS-1$
276c17e7
BH
350 /**
351 * Pattern to match introduction line of context list.
352 */
046b6849 353 static final 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$
276c17e7
BH
354 /**
355 * Pattern to match introduction line of context list.
356 */
046b6849 357 static final Pattern ADD_CONTEXT_HELP_CONTEXTS_END_LINE = Pattern.compile("\\s*Example.*"); //$NON-NLS-1$
a07c7629
BH
358 /**
359 * Pattern to match error line if no kernel tracer is available or installed.
360 */
046b6849 361 static final Pattern LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN = Pattern.compile("\\s*Error:\\s+Unable\\s+to\\s+list\\s+kernel\\s+events.*"); //$NON-NLS-1$;
f3e2f354
BH
362 /**
363 * Pattern to match error line if no ust tracer is available or installed.
364 */
046b6849 365 static final Pattern LIST_UST_NO_UST_PROVIDER_PATTERN = Pattern.compile(".*Unable\\s*to\\s*list\\s*UST\\s*event.*"); //$NON-NLS-1$;
276c17e7 366}
This page took 0.053629 seconds and 5 git commands to generate.