lttng: Fix not being able to get available context with 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
index 4511e75c2189945f35aeab42eb63d7411cec1abd..934c1de7a2192d2e63e78b7785584097c4c79a91 100644 (file)
@@ -14,8 +14,6 @@
  **********************************************************************/
 package org.eclipse.tracecompass.internal.lttng2.control.ui.views.service;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.regex.Pattern;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
@@ -36,7 +34,7 @@ public interface LTTngControlServiceConstants {
     /**
      * Pattern to match the LTTng toolchain version 2.x.y.
      */
-    Pattern VERSION_2_PATTERN = checkNotNull(Pattern.compile("(2\\.\\d+\\.\\d+).*")); //$NON-NLS-1$
+    Pattern VERSION_2_PATTERN = Pattern.compile("(2\\.\\d+\\.\\d+).*"); //$NON-NLS-1$
 
     // ------------------------------------------------------------------------
     // Constants
@@ -121,10 +119,6 @@ public interface LTTngControlServiceConstants {
      * Command to add a context to channels and/or events
      */
     String COMMAND_ADD_CONTEXT = "add-context"; //$NON-NLS-1$
-    /**
-     * Command to execute calibrate command to quantify LTTng overhead
-     */
-    String COMMAND_CALIBRATE = "calibrate"; //$NON-NLS-1$
     /**
      * Command to execute sub-command snapshot
      */
@@ -250,9 +244,14 @@ public interface LTTngControlServiceConstants {
      */
     String OPTION_READ_TIMER = "--read-timer";  //$NON-NLS-1$
     /**
-     * Command line option for printing the help of a specif command
+     * Command line option for printing the help of a specific command
      */
     String OPTION_HELP = "-h";  //$NON-NLS-1$
+    /**
+     * Command line option for listing things. For example listing available
+     * context.
+     */
+    String OPTION_LIST = "--list"; //$NON-NLS-1$
     /**
      * Command line option for listing the fields of UST tracepoints
      */
@@ -308,97 +307,97 @@ public interface LTTngControlServiceConstants {
     /**
      * Pattern to match the version.
      */
-    Pattern VERSION_PATTERN = checkNotNull(Pattern.compile(".*lttng\\s+version\\s+.*(\\d+\\.\\d+\\.\\d+).*")); //$NON-NLS-1$
+    Pattern VERSION_PATTERN = Pattern.compile(".*lttng\\s+version\\s+.*(\\d+\\.\\d+\\.\\d+).*"); //$NON-NLS-1$
     /**
      * Pattern to match for error output
      */
-    Pattern ERROR_PATTERN = checkNotNull(Pattern.compile("\\s*Error\\:.*")); //$NON-NLS-1$
+    Pattern ERROR_PATTERN = Pattern.compile("\\s*Error\\:.*"); //$NON-NLS-1$
     /**
      * Pattern to match for session information (lttng list)
      */
-    Pattern SESSION_PATTERN = checkNotNull(Pattern.compile("\\s+(\\d+)\\)\\s+(.*)\\s+\\((.*)\\)\\s+\\[(active|inactive).*\\].*")); //$NON-NLS-1$
+    Pattern SESSION_PATTERN = Pattern.compile("\\s+(\\d+)\\)\\s+(.*)\\s+\\((.*)\\)\\s+\\[(active|inactive).*\\].*"); //$NON-NLS-1$
     /**
      * Pattern to match for session information (lttng list <session>)
      */
-    Pattern TRACE_SESSION_PATTERN = checkNotNull(Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\].*")); //$NON-NLS-1$
+    Pattern TRACE_SESSION_PATTERN = Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\].*"); //$NON-NLS-1$
     /**
      * Pattern to match for snapshot session information (lttng list <session>)
      */
-    Pattern TRACE_SNAPSHOT_SESSION_PATTERN = checkNotNull(Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\s*snapshot\\].*")); //$NON-NLS-1$
+    Pattern TRACE_SNAPSHOT_SESSION_PATTERN = Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\s*snapshot\\].*"); //$NON-NLS-1$
     /**
      * Pattern to match for session path information (lttng list <session>)
      */
-    Pattern TRACE_SESSION_PATH_PATTERN = checkNotNull(Pattern.compile("\\s*Trace\\s+path\\:\\s+(.*)")); //$NON-NLS-1$
+    Pattern TRACE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(.*)"); //$NON-NLS-1$
     /**
      * Pattern to match session path for network tracing (lttng list <session>)
      * Note: file for protocol is not considered as network trace since local consumer will be used.
      */
-    Pattern TRACE_NETWORK_PATH_PATTERN = checkNotNull(Pattern.compile("\\s*Trace\\s+path\\:\\s+(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}")); //$NON-NLS-1$
+    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$
     /**
      * Pattern to match session path for network tracing
      * Note: file for protocol is not considered as network trace since local consumer will be used.
      */
-    Pattern TRACE_NETWORK_PATTERN = checkNotNull(Pattern.compile("\\s*(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}")); //$NON-NLS-1$
+    Pattern TRACE_NETWORK_PATTERN = Pattern.compile("\\s*(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$
     /**
      * Sub-pattern to pattern TRACE_NETWORK_PATH_PATTERN to match file protocol
      */
-    Pattern TRACE_FILE_PROTOCOL_PATTERN = checkNotNull(Pattern.compile("(file)\\:\\/\\/(.*)")); //$NON-NLS-1$
+    Pattern TRACE_FILE_PROTOCOL_PATTERN = Pattern.compile("(file)\\:\\/\\/(.*)"); //$NON-NLS-1$
     /**
      * Pattern to match for kernel domain information (lttng list <session>)
      */
-    Pattern DOMAIN_KERNEL_PATTERN = checkNotNull(Pattern.compile("=== Domain: Kernel ===")); //$NON-NLS-1$
+    Pattern DOMAIN_KERNEL_PATTERN = Pattern.compile("=== Domain: Kernel ==="); //$NON-NLS-1$
     /**
      * Pattern to match for ust domain information (lttng list <session>)
      */
-    Pattern DOMAIN_UST_GLOBAL_PATTERN = checkNotNull(Pattern.compile("=== Domain: UST global ===")); //$NON-NLS-1$
+    Pattern DOMAIN_UST_GLOBAL_PATTERN = Pattern.compile("=== Domain: UST global ==="); //$NON-NLS-1$
     /**
      * Pattern to match for matching warning about no kernel channel
      */
-    Pattern DOMAIN_NO_KERNEL_CHANNEL_PATTERN = checkNotNull(Pattern.compile("\\s*Warning\\:\\s+No kernel\\s+channel.*")); //$NON-NLS-1$
+    Pattern DOMAIN_NO_KERNEL_CHANNEL_PATTERN = Pattern.compile("\\s*Warning\\:\\s+No kernel\\s+channel.*"); //$NON-NLS-1$
     /**
      * Pattern to match for matching warning about no UST channel
      */
-    Pattern DOMAIN_NO_UST_CHANNEL_PATTERN = checkNotNull(Pattern.compile("\\s*Error\\:\\s+UST\\s+channel\\s+not\\s+found.*")); //$NON-NLS-1$
+    Pattern DOMAIN_NO_UST_CHANNEL_PATTERN = Pattern.compile("\\s*Error\\:\\s+UST\\s+channel\\s+not\\s+found.*"); //$NON-NLS-1$
     /**
      * Pattern to match for buffer type (lttng list <session>)
      */
-    Pattern BUFFER_TYPE_PATTERN = checkNotNull(Pattern.compile("\\s*Buffer\\s+type\\:.*")); //$NON-NLS-1$
+    Pattern BUFFER_TYPE_PATTERN = Pattern.compile("\\s*Buffer\\s+type\\:.*"); //$NON-NLS-1$
     /**
      * Pattern to match for channels section (lttng list <session>)
      */
-    Pattern CHANNELS_SECTION_PATTERN = checkNotNull(Pattern.compile("\\s*Channels\\:")); //$NON-NLS-1$
+    Pattern CHANNELS_SECTION_PATTERN = Pattern.compile("\\s*Channels\\:"); //$NON-NLS-1$
     /**
      * Pattern to match for channel information (lttng list <session>)
      */
-    Pattern CHANNEL_PATTERN = checkNotNull(Pattern.compile("\\s*-\\s+(.*)\\:\\s+\\[(enabled|disabled)\\]")); //$NON-NLS-1$
+    Pattern CHANNEL_PATTERN = Pattern.compile("\\s*-\\s+(.*)\\:\\s+\\[(enabled|disabled)\\]"); //$NON-NLS-1$
     /**
      * Pattern to match for events section information (lttng list <session>)
      */
-    Pattern EVENT_SECTION_PATTERN = checkNotNull(Pattern.compile("\\s*Events\\:")); //$NON-NLS-1$
+    Pattern EVENT_SECTION_PATTERN = Pattern.compile("\\s*Events\\:"); //$NON-NLS-1$
     /**
      * Pattern to match for event information (lttng list <session>)
      */
-    Pattern EVENT_PATTERN = checkNotNull(Pattern.compile("\\s+(.*)\\s+\\(loglevel\\s*(:|<=|==)\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*")); //$NON-NLS-1$
+    Pattern EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(loglevel\\s*(:|<=|==)\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$
     /**
      * Pattern to match a wildcarded event information (lttng list <session>)
      */
-    Pattern WILDCARD_EVENT_PATTERN = checkNotNull(Pattern.compile("\\s+(.*)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*")); //$NON-NLS-1$
+    Pattern WILDCARD_EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$
     /**
      * Pattern to match a probe address information (lttng list <session>)
      */
-    Pattern PROBE_ADDRESS_PATTERN = checkNotNull(Pattern.compile("\\s+(addr)\\:\\s+(0x[0-9a-fA-F]{1,16})")); //$NON-NLS-1$
+    Pattern PROBE_ADDRESS_PATTERN = Pattern.compile("\\s+(addr)\\:\\s+(0x[0-9a-fA-F]{1,16})"); //$NON-NLS-1$
     /**
      * Pattern to match a probe OFFSET information (lttng list <session>)
      */
-    Pattern PROBE_OFFSET_PATTERN = checkNotNull(Pattern.compile("\\s+(offset)\\:\\s+(0x[0-9a-fA-F]{1,16})")); //$NON-NLS-1$
+    Pattern PROBE_OFFSET_PATTERN = Pattern.compile("\\s+(offset)\\:\\s+(0x[0-9a-fA-F]{1,16})"); //$NON-NLS-1$
     /**
      * Pattern to match a probe SYMBOL information (lttng list <session>)
      */
-    Pattern PROBE_SYMBOL_PATTERN = checkNotNull(Pattern.compile("\\s+(symbol)\\:\\s+(.+)")); //$NON-NLS-1$
+    Pattern PROBE_SYMBOL_PATTERN = Pattern.compile("\\s+(symbol)\\:\\s+(.+)"); //$NON-NLS-1$
     /**
      * Pattern to match for channel (overwite mode) information (lttng list <session>)
      */
-    Pattern OVERWRITE_MODE_ATTRIBUTE = checkNotNull(Pattern.compile("\\s+overwrite\\s+mode\\:.*")); //$NON-NLS-1$
+    Pattern OVERWRITE_MODE_ATTRIBUTE = Pattern.compile("\\s+overwrite\\s+mode\\:.*"); //$NON-NLS-1$
     /**
      * Pattern to match indicating false for overwrite mode
      */
@@ -410,83 +409,83 @@ public interface LTTngControlServiceConstants {
     /**
      * Pattern to match for channel (sub-buffer size) information (lttng list <session>)
      */
-    Pattern SUBBUFFER_SIZE_ATTRIBUTE = checkNotNull(Pattern.compile("\\s+subbufers\\s+size\\:.*")); //$NON-NLS-1$
+    Pattern SUBBUFFER_SIZE_ATTRIBUTE = Pattern.compile("\\s+subbufers\\s+size\\:.*"); //$NON-NLS-1$
     /**
      * Pattern to match for channel (number of sub-buffers) information (lttng list <session>)
      */
-    Pattern NUM_SUBBUFFERS_ATTRIBUTE = checkNotNull(Pattern.compile("\\s+number\\s+of\\s+subbufers\\:.*")); //$NON-NLS-1$
+    Pattern NUM_SUBBUFFERS_ATTRIBUTE = Pattern.compile("\\s+number\\s+of\\s+subbufers\\:.*"); //$NON-NLS-1$
     /**
      * Pattern to match for channel (switch timer) information (lttng list <session>)
      */
-    Pattern SWITCH_TIMER_ATTRIBUTE = checkNotNull(Pattern.compile("\\s+switch\\s+timer\\s+interval\\:.*")); //$NON-NLS-1$
+    Pattern SWITCH_TIMER_ATTRIBUTE = Pattern.compile("\\s+switch\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$
     /**
      * Pattern to match for channel (read timer) information (lttng list <session>)
      */
-    Pattern READ_TIMER_ATTRIBUTE = checkNotNull(Pattern.compile("\\s+read\\s+timer\\s+interval\\:.*")); //$NON-NLS-1$
+    Pattern READ_TIMER_ATTRIBUTE = Pattern.compile("\\s+read\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$
     /**
      * Pattern to match for channel (output type) information (lttng list <session>)
      */
-    Pattern OUTPUT_ATTRIBUTE = checkNotNull(Pattern.compile("\\s+output\\:.*")); //$NON-NLS-1$
+    Pattern OUTPUT_ATTRIBUTE = Pattern.compile("\\s+output\\:.*"); //$NON-NLS-1$
     /**
      * Pattern to match for channel (trace file size) information (lttng list <session>)
      */
-    Pattern TRACE_FILE_COUNT_ATTRIBUTE = checkNotNull(Pattern.compile("\\s+trace\\s+file\\s+count\\:.*")); //$NON-NLS-1$
+    Pattern TRACE_FILE_COUNT_ATTRIBUTE = Pattern.compile("\\s+trace\\s+file\\s+count\\:.*"); //$NON-NLS-1$
     /**
      * Pattern to match for channel (trace file size) information (lttng list <session>)
      */
-    Pattern TRACE_FILE_SIZE_ATTRIBUTE = checkNotNull(Pattern.compile("\\s+trace\\s+file\\s+size\\s+\\(bytes\\)\\:.*")); //$NON-NLS-1$
+    Pattern TRACE_FILE_SIZE_ATTRIBUTE = Pattern.compile("\\s+trace\\s+file\\s+size\\s+\\(bytes\\)\\:.*"); //$NON-NLS-1$
     /**
      * Pattern to match for provider information (lttng list -k/-u)
      */
-    Pattern PROVIDER_EVENT_PATTERN = checkNotNull(Pattern.compile("\\s*(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)")); //$NON-NLS-1$
+    Pattern PROVIDER_EVENT_PATTERN = Pattern.compile("\\s*(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)"); //$NON-NLS-1$
     /**
      * Pattern to match event fields
      */
-    Pattern EVENT_FIELD_PATTERN = checkNotNull(Pattern.compile("\\s*(field:)\\s+(.*)\\s+\\((.*)\\)")); //$NON-NLS-1$
+    Pattern EVENT_FIELD_PATTERN = Pattern.compile("\\s*(field:)\\s+(.*)\\s+\\((.*)\\)"); //$NON-NLS-1$
     /**
      * Pattern to match for UST provider information (lttng list -u)
      */
-    Pattern UST_PROVIDER_PATTERN = checkNotNull(Pattern.compile("\\s*PID\\:\\s+(\\d+)\\s+-\\s+Name\\:\\s+(.*)")); //$NON-NLS-1$
+    Pattern UST_PROVIDER_PATTERN = Pattern.compile("\\s*PID\\:\\s+(\\d+)\\s+-\\s+Name\\:\\s+(.*)"); //$NON-NLS-1$
     /**
      * Pattern to match for session information (lttng create <session name>)
      */
-    Pattern CREATE_SESSION_NAME_PATTERN = checkNotNull(Pattern.compile(".*Session\\s+(.*)\\s+created\\.")); //$NON-NLS-1$
+    Pattern CREATE_SESSION_NAME_PATTERN = Pattern.compile(".*Session\\s+(.*)\\s+created\\."); //$NON-NLS-1$
     /**
      * Pattern to match for session path information (lttng create <session name>)
      */
-    Pattern CREATE_SESSION_PATH_PATTERN = checkNotNull(Pattern.compile("\\s*Traces\\s+will\\s+be\\s+written\\s+in\\s+(.*).*")); //$NON-NLS-1$
+    Pattern CREATE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Traces\\s+will\\s+be\\s+written\\s+in\\s+(.*).*"); //$NON-NLS-1$
     /**
      * Pattern to match for session command output for "session name not found".
      */
-    Pattern SESSION_NOT_FOUND_ERROR_PATTERN = checkNotNull(Pattern.compile("\\s*Error:\\s+Session\\s+name\\s.*not\\s+found")); //$NON-NLS-1$
+    Pattern SESSION_NOT_FOUND_ERROR_PATTERN = Pattern.compile("\\s*Error:\\s+Session\\s+name\\s.*not\\s+found"); //$NON-NLS-1$
     /**
      * Pattern to match introduction line of context list.
      */
-    Pattern ADD_CONTEXT_HELP_CONTEXTS_INTRO = checkNotNull(Pattern.compile("\\s*TYPE can\\s+be\\s+one\\s+of\\s+the\\s+strings\\s+below.*")); //$NON-NLS-1$
+    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$
     /**
      * Pattern to match introduction line of context list.
      */
-    Pattern ADD_CONTEXT_HELP_CONTEXTS_END_LINE = checkNotNull(Pattern.compile("\\s*Example.*")); //$NON-NLS-1$
+    Pattern ADD_CONTEXT_HELP_CONTEXTS_END_LINE = Pattern.compile("\\s*Example.*"); //$NON-NLS-1$
     /**
      * Pattern to match error line if no kernel tracer is available or installed.
      */
-    Pattern LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN = checkNotNull(Pattern.compile("\\s*Error:\\s+Unable\\s+to\\s+list\\s+kernel\\s+events.*")); //$NON-NLS-1$;
+    Pattern LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN = Pattern.compile("\\s*Error:\\s+Unable\\s+to\\s+list\\s+kernel\\s+events.*"); //$NON-NLS-1$;
     /**
      * Pattern to match error line if no ust tracer is available or installed.
      */
-    Pattern LIST_UST_NO_UST_PROVIDER_PATTERN = checkNotNull(Pattern.compile(".*Unable\\s*to\\s*list\\s*UST\\s*event.*")); //$NON-NLS-1$;
+    Pattern LIST_UST_NO_UST_PROVIDER_PATTERN = Pattern.compile(".*Unable\\s*to\\s*list\\s*UST\\s*event.*"); //$NON-NLS-1$;
     /**
      * Pattern to match for list snapshot information (lttng snapshot list-output)
      */
-    Pattern LIST_SNAPSHOT_OUTPUT_PATTERN = checkNotNull(Pattern.compile("\\s+\\[(\\d+)\\]\\s+(\\S*)\\:\\s+(\\S*)(.*)")); //$NON-NLS-1$
+    Pattern LIST_SNAPSHOT_OUTPUT_PATTERN = Pattern.compile("\\s+\\[(\\d+)\\]\\s+(\\S*)\\:\\s+(\\S*)(.*)"); //$NON-NLS-1$
     /**
      * Pattern to match the live timer interval line of session list.
      */
-    Pattern LIST_LIVE_TIMER_INTERVAL_PATTERN = checkNotNull(Pattern.compile("\\s*Live\\stimer\\sinterval\\s\\(usec\\):\\s(\\d+)")); //$NON-NLS-1$
+    Pattern LIST_LIVE_TIMER_INTERVAL_PATTERN = Pattern.compile("\\s*Live\\stimer\\sinterval\\s\\(usec\\):\\s(\\d+)"); //$NON-NLS-1$
     /**
      * Pattern to match snapshot path for network tracing (lttng list <session>)
      * Note: file for protocol is not considered as network trace since local consumer will be used.
      */
-    Pattern SNAPSHOT_NETWORK_PATH_PATTERN = checkNotNull(Pattern.compile("(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}")); //$NON-NLS-1$
+    Pattern SNAPSHOT_NETWORK_PATH_PATTERN = Pattern.compile("(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$
 
 }
This page took 0.035948 seconds and 5 git commands to generate.