lttng: Add schema for LTTng MI 3.0 (LTTng 2.8)
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Fri, 8 Apr 2016 03:45:48 +0000 (23:45 -0400)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Wed, 27 Apr 2016 00:55:39 +0000 (20:55 -0400)
This makes it possible to use the LTTng Control view with schema
validation enabled and LTTng 2.8. The MI service is modified to be able
to handle a different schema depending on the LTTng version.

Change-Id: I85ec15edc3f0ce942d8df8637eadba3968fef1ca
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/70188
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlComponentTest.java
lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlService.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/mi-lttng-3.0.xsd [new file with mode: 0644]

index 2ddb6e988b6f2887bf347394ed6298b405439e39..e9910dfb8fbbae335424924a86c17ffc1f42849d 100644 (file)
@@ -33,7 +33,6 @@ import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.Trac
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceControlRoot;
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.ILttngControlService;
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlService;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants;
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceMI;
 import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
 import org.eclipse.ui.ISharedImages;
@@ -277,7 +276,7 @@ public class TraceControlComponentTest {
         assertNotNull(service);
         assertEquals(service, result);
 
-        service = new LTTngControlServiceMI(proxy.createCommandShell(), LTTngControlServiceMI.class.getResource(LTTngControlServiceConstants.MI_XSD_FILENAME));
+        service = new LTTngControlServiceMI(proxy.createCommandShell(), null);
         fixture.setControlService(service);
         result = fixture.getControlService();
         assertNotNull(service);
index 06f479036a5db3509c2c56cc9bfcf431bdab198b..01abe382543665800029408b3f9446400fb1fa72 100644 (file)
@@ -17,7 +17,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.net.URL;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -37,8 +36,8 @@ import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionS
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.SessionInfo;
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.ILttngControlService;
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlService;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants;
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceMI;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LttngVersion;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -59,8 +58,7 @@ public class LTTngControlServiceMiTest extends LTTngControlServiceTest {
     @Override
     protected ILttngControlService getControlService() {
         try {
-            URL resource = LTTngControlServiceMI.class.getResource(LTTngControlServiceConstants.MI_XSD_FILENAME);
-            return new LTTngControlServiceMI(getShell(), resource);
+            return new LTTngControlServiceMI(getShell(), new LttngVersion("2.7.0"));
         } catch (ExecutionException e) {
             return null;
         }
index 378504ed51e8d46d34b9f84e36d68a735ba8b14b..4e60b2c8e5adf1cac84a79cf0a03cf5a0c92ca62 100644 (file)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2012, 2015 Ericsson
+ * Copyright (c) 2012, 2016 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -128,7 +128,7 @@ public class LTTngControlService implements ILttngControlService {
      * @param version
      *            - a version to set
      */
-    public void setVersion(LttngVersion version) {
+    protected void setVersion(LttngVersion version) {
         if (version != null) {
             fVersion = version;
         }
index 934c1de7a2192d2e63e78b7785584097c4c79a91..09df0bf9b14f74b54674f96ae7bf7335e2cba4f1 100644 (file)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2012, 2015 Ericsson
+ * Copyright (c) 2012, 2016 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -60,6 +60,11 @@ public interface LTTngControlServiceConstants {
      * output from LTTng
      */
     String MI_XSD_FILENAME = "mi_lttng.xsd"; //$NON-NLS-1$
+    /**
+     * Name of the XSD to validate against the xml machine interface
+     * output from LTTng, version 3.0
+     */
+    String MI3_XSD_FILENAME = "mi-lttng-3.0.xsd"; //$NON-NLS-1$
     // ------------------------------------------------------------------------
     // Command constants
     // ------------------------------------------------------------------------
index 6d9407725e643a66021986d48716eac3668f2fe9..ed42397426e8f3caeb8f294af1dc4a46a5ffa5f1 100644 (file)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2012, 2015 Ericsson
+ * Copyright (c) 2012, 2016 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -80,8 +80,7 @@ public final class LTTngControlServiceFactory {
 
         if ((result.getResult() == 0) && (!result.getOutput().isEmpty())) {
             if (machineInterfaceMode) {
-                LTTngControlServiceMI service = new LTTngControlServiceMI(shell, LTTngControlService.class.getResource(LTTngControlServiceConstants.MI_XSD_FILENAME));
-                service.setVersion(result.getOutput());
+                LTTngControlServiceMI service = new LTTngControlServiceMI(shell, LTTngControlServiceMI.parseVersion(result));
                 return service;
             }
 
index 4fadc2f2f058fb3487b9fe9b5fa6d7116bed284b..f026bef5e15d5c64b1798db4db203e666780bea2 100644 (file)
@@ -100,23 +100,29 @@ public class LTTngControlServiceMI extends LTTngControlService {
      *
      * @param shell
      *            the command shell implementation to use
-     * @param xsdUrl
-     *            the xsd schema file for validation
+     * @param version
+     *            the lttng version
      * @throws ExecutionException
      *             if the creation of the Schema and DocumentBuilder objects
      *             fails
      */
-    public LTTngControlServiceMI(@NonNull ICommandShell shell, @Nullable URL xsdUrl) throws ExecutionException {
+    public LTTngControlServiceMI(@NonNull ICommandShell shell, @Nullable LttngVersion version) throws ExecutionException {
         super(shell);
+        setVersion(version);
 
         DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
         docBuilderFactory.setValidating(false);
 
         if (isSchemaValidationEnabled()) {
-            // Validate XSD schema
-            if (xsdUrl != null) {
+            if (version != null) {
                 SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
                 try {
+                    URL xsdUrl = LTTngControlService.class.getResource(LTTngControlServiceConstants.MI_XSD_FILENAME);
+                    if (version.compareTo(new LttngVersion(2, 8, 0, null, null, null, null, null, null)) >= 0) {
+                        xsdUrl = LTTngControlService.class.getResource(LTTngControlServiceConstants.MI3_XSD_FILENAME);
+                        // MI 3.0 added name spaces. It will fail to validate if this is not set to true.
+                        docBuilderFactory.setNamespaceAware(true);
+                    }
                     docBuilderFactory.setSchema(schemaFactory.newSchema(xsdUrl));
                 } catch (SAXException e) {
                     throw new ExecutionException(Messages.TraceControl_InvalidSchemaError, e);
@@ -145,11 +151,13 @@ public class LTTngControlServiceMI extends LTTngControlService {
      *
      * @param xmlStrings
      *            list of strings representing an xml input
+     * @param documentBuilder
+     *            the builder used to get the document
      * @return Document generated from strings input
      * @throws ExecutionException
      *             when parsing has failed
      */
-    private Document getDocumentFromStrings(List<String> xmlStrings) throws ExecutionException {
+    private static Document getDocumentFromStrings(List<String> xmlStrings, DocumentBuilder documentBuilder) throws ExecutionException {
         StringBuilder concatenedString = new StringBuilder();
         for (String string : xmlStrings) {
             concatenedString.append(string);
@@ -158,7 +166,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
 
         Document document;
         try {
-            document = fDocumentBuilder.parse(stream);
+            document = documentBuilder.parse(stream);
         } catch (SAXException | IOException e) {
             throw new ExecutionException(Messages.TraceControl_XmlParsingError + ':' + e.toString(), e);
         }
@@ -167,16 +175,29 @@ public class LTTngControlServiceMI extends LTTngControlService {
     }
 
     /**
-     * Parse, populate and set the internal LTTngVersion variable
-     *
-     * @param xmlOutput
-     *            the mi xml output of lttng version
+     * Parse LTTng version from a MI command result
+     * 
+     * @param commandResult
+     *            the result obtained from a MI command
+     * @return the LTTng version
      * @throws ExecutionException
      *             when xml extraction fail
      */
-    public void setVersion(List<String> xmlOutput) throws ExecutionException {
-        Document doc = getDocumentFromStrings(xmlOutput);
+    public static LttngVersion parseVersion(ICommandResult commandResult) throws ExecutionException {
+        DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder documentBuilder;
+        try {
+            documentBuilder = docBuilderFactory.newDocumentBuilder();
+        } catch (ParserConfigurationException e) {
+            throw new ExecutionException(Messages.TraceControl_XmlDocumentBuilderError, e);
+        }
+
+        Document doc = getDocumentFromStrings(commandResult.getOutput(), documentBuilder);
         NodeList element = doc.getElementsByTagName(MIStrings.VERSION);
+        if (element.getLength() != 1) {
+            throw new ExecutionException(Messages.TraceControl_UnsupportedVersionError);
+        }
+
         int major = 0;
         int minor = 0;
         int patchLevel = 0;
@@ -186,47 +207,43 @@ public class LTTngControlServiceMI extends LTTngControlService {
         String description = ""; //$NON-NLS-1$
         String url = ""; //$NON-NLS-1$
         String fullVersion = ""; //$NON-NLS-1$
-        if (element.getLength() == 1) {
-            NodeList child = element.item(0).getChildNodes();
-            // Get basic information
-            for (int i = 0; i < child.getLength(); i++) {
-                Node node = child.item(i);
-                switch (node.getNodeName()) {
-                case MIStrings.VERSION_MAJOR:
-                    major = Integer.parseInt(node.getTextContent());
-                    break;
-                case MIStrings.VERSION_MINOR:
-                    minor = Integer.parseInt(node.getTextContent());
-                    break;
-                case MIStrings.VERSION_PATCH_LEVEL:
-                    patchLevel = Integer.parseInt(node.getTextContent());
-                    break;
-                case MIStrings.VERSION_COMMIT:
-                    commit = node.getTextContent();
-                    break;
-                case MIStrings.VERSION_DESCRIPTION:
-                    description = node.getTextContent();
-                    break;
-                case MIStrings.VERSION_LICENSE:
-                    license = node.getTextContent();
-                    break;
-                case MIStrings.VERSION_NAME:
-                    name = node.getTextContent();
-                    break;
-                case MIStrings.VERSION_STR:
-                    fullVersion = node.getTextContent();
-                    break;
-                case MIStrings.VERSION_WEB:
-                    url = node.getTextContent();
-                    break;
-                default:
-                    break;
-                }
+        NodeList child = element.item(0).getChildNodes();
+        // Get basic information
+        for (int i = 0; i < child.getLength(); i++) {
+            Node node = child.item(i);
+            switch (node.getNodeName()) {
+            case MIStrings.VERSION_MAJOR:
+                major = Integer.parseInt(node.getTextContent());
+                break;
+            case MIStrings.VERSION_MINOR:
+                minor = Integer.parseInt(node.getTextContent());
+                break;
+            case MIStrings.VERSION_PATCH_LEVEL:
+                patchLevel = Integer.parseInt(node.getTextContent());
+                break;
+            case MIStrings.VERSION_COMMIT:
+                commit = node.getTextContent();
+                break;
+            case MIStrings.VERSION_DESCRIPTION:
+                description = node.getTextContent();
+                break;
+            case MIStrings.VERSION_LICENSE:
+                license = node.getTextContent();
+                break;
+            case MIStrings.VERSION_NAME:
+                name = node.getTextContent();
+                break;
+            case MIStrings.VERSION_STR:
+                fullVersion = node.getTextContent();
+                break;
+            case MIStrings.VERSION_WEB:
+                url = node.getTextContent();
+                break;
+            default:
+                break;
             }
-            setVersion(new LttngVersion(major, minor, patchLevel, license, commit, name, description, url, fullVersion));
-        } else {
-            throw new ExecutionException(Messages.TraceControl_UnsupportedVersionError);
         }
+        return new LttngVersion(major, minor, patchLevel, license, commit, name, description, url, fullVersion);
     }
 
     @Override
@@ -234,7 +251,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
         ICommandInput command = createCommand(LTTngControlServiceConstants.COMMAND_LIST);
         ICommandResult result = executeCommand(command, monitor);
 
-        Document doc = getDocumentFromStrings(result.getOutput());
+        Document doc = getDocumentFromStrings(result.getOutput(), fDocumentBuilder);
 
         NodeList elements = doc.getElementsByTagName(MIStrings.NAME);
 
@@ -254,7 +271,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
         ICommandResult result = executeCommand(command, monitor);
 
         ISessionInfo sessionInfo = new SessionInfo(sessionName);
-        Document document = getDocumentFromStrings(result.getOutput());
+        Document document = getDocumentFromStrings(result.getOutput(), fDocumentBuilder);
 
         NodeList sessionsNode = document.getElementsByTagName(MIStrings.SESSION);
         // There should be only one session
@@ -494,7 +511,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
         // For now only keep the last one.
         ICommandInput command = createCommand(LTTngControlServiceConstants.COMMAND_SNAPSHOT, LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName);
         ICommandResult result = executeCommand(command, monitor);
-        Document doc = getDocumentFromStrings(result.getOutput());
+        Document doc = getDocumentFromStrings(result.getOutput(), fDocumentBuilder);
         NodeList rawSnapshotsOutputs = doc.getElementsByTagName(MIStrings.SNAPSHOT_OUTPUTS);
 
         ISnapshotInfo snapshotInfo = new SnapshotInfo(""); //$NON-NLS-1$
@@ -551,7 +568,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
             throw new ExecutionException(Messages.TraceControl_CommandError + command.toString());
         }
 
-        Document document = getDocumentFromStrings(result.getOutput());
+        Document document = getDocumentFromStrings(result.getOutput(), fDocumentBuilder);
         NodeList rawEvents = document.getElementsByTagName(MIStrings.EVENT);
         getBaseEventInfo(rawEvents, events);
         return events;
@@ -579,7 +596,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
             throw new ExecutionException(Messages.TraceControl_CommandError + command.toString());
         }
 
-        Document document = getDocumentFromStrings(result.getOutput());
+        Document document = getDocumentFromStrings(result.getOutput(), fDocumentBuilder);
         NodeList rawProviders = document.getElementsByTagName(MIStrings.PID);
 
         IUstProviderInfo providerInfo = null;
@@ -625,7 +642,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
         ICommandInput command = prepareSessionCreationCommand(sessionInfo);
         ICommandResult result = executeCommand(command, monitor);
 
-        Document document = getDocumentFromStrings(result.getOutput());
+        Document document = getDocumentFromStrings(result.getOutput(), fDocumentBuilder);
         NodeList sessions = document.getElementsByTagName(MIStrings.SESSION);
 
         // Number of session should be equal to 1
@@ -668,7 +685,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
 
         ICommandResult result = executeCommand(command, monitor);
 
-        Document document = getDocumentFromStrings(result.getOutput());
+        Document document = getDocumentFromStrings(result.getOutput(), fDocumentBuilder);
         NodeList sessions = document.getElementsByTagName(MIStrings.SESSION);
 
         // Number of session should be equal to 1
@@ -734,7 +751,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
         }
 
         // Check for action effect
-        Document doc = getDocumentFromStrings(result.getOutput());
+        Document doc = getDocumentFromStrings(result.getOutput(), fDocumentBuilder);
         NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION);
         if (sessions.getLength() != 1) {
             throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION));
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/mi-lttng-3.0.xsd b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/mi-lttng-3.0.xsd
new file mode 100644 (file)
index 0000000..436a989
--- /dev/null
@@ -0,0 +1,579 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2014 - Oliver Cotte <olivier.cotte@polymtl.ca>
+                   - Jonathan Rajotte <jonathan.r.julien@gmail.com>
+Copyright (c) 2016 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+       targetNamespace="http://lttng.org/xml/ns/lttng-mi"
+       xmlns:tns="http://lttng.org/xml/ns/lttng-mi"
+       elementFormDefault="qualified" version="3.0">
+
+       <!-- Maps to the uint32_t type -->
+       <xs:simpleType name="uint32_type">
+               <xs:restriction base="xs:integer">
+                       <xs:minInclusive value="0" />
+                       <xs:maxInclusive value="4294967295" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the uint64_t type -->
+       <xs:simpleType name="uint64_type">
+               <xs:restriction base="xs:integer">
+                       <xs:minInclusive value="0" />
+                       <xs:maxInclusive value="18446744073709551615" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the char name[LTTNG_SYMBOL_NAME_LEN] -->
+       <xs:simpleType name="name_type">
+               <xs:restriction base="xs:string">
+                       <xs:maxLength value="255" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the lttng_event_type enum -->
+       <xs:simpleType name="event_type_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="ALL" />
+                       <xs:enumeration value="TRACEPOINT" />
+                       <xs:enumeration value="PROBE" />
+                       <xs:enumeration value="FUNCTION" />
+                       <xs:enumeration value="FUNCTION_ENTRY" />
+                       <xs:enumeration value="NOOP" />
+                       <xs:enumeration value="SYSCALL" />
+                       <xs:enumeration value="KPROBE" />
+                       <xs:enumeration value="KRETPROBE" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the lttng_event_field_type enum -->
+       <xs:simpleType name="event_field_type_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="OTHER" />
+                       <xs:enumeration value="INTEGER" />
+                       <xs:enumeration value="ENUM" />
+                       <xs:enumeration value="FLOAT" />
+                       <xs:enumeration value="STRING" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the lttng_loglevel_type enum -->
+       <xs:simpleType name="loglevel_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="ALL" />
+                       <xs:enumeration value="RANGE" />
+                       <xs:enumeration value="SINGLE" />
+                       <xs:enumeration value="UNKNOWN" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the lttng_event_context_type enum -->
+       <xs:simpleType name="context_type_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="PID" />
+                       <xs:enumeration value="PROCNAME" />
+                       <xs:enumeration value="PRIO" />
+                       <xs:enumeration value="NICE" />
+                       <xs:enumeration value="VPID" />
+                       <xs:enumeration value="TID" />
+                       <xs:enumeration value="VTID" />
+                       <xs:enumeration value="PPID" />
+                       <xs:enumeration value="VPPID" />
+                       <xs:enumeration value="PTHREAD_ID" />
+                       <xs:enumeration value="HOSTNAME" />
+                       <xs:enumeration value="IP" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to loglevel_string char * -->
+       <xs:simpleType name="loglevel_string_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="" />
+                       <xs:enumeration value="TRACE_EMERG" />
+                       <xs:enumeration value="TRACE_ALERT" />
+                       <xs:enumeration value="TRACE_CRIT" />
+                       <xs:enumeration value="TRACE_ERR" />
+                       <xs:enumeration value="TRACE_WARNING" />
+                       <xs:enumeration value="TRACE_NOTICE" />
+                       <xs:enumeration value="TRACE_INFO" />
+                       <xs:enumeration value="TRACE_DEBUG_SYSTEM" />
+                       <xs:enumeration value="TRACE_DEBUG_PROGRAM" />
+                       <xs:enumeration value="TRACE_DEBUG_PROCESS" />
+                       <xs:enumeration value="TRACE_DEBUG_MODULE" />
+                       <xs:enumeration value="TRACE_DEBUG_UNIT" />
+                       <xs:enumeration value="TRACE_DEBUG_FUNCTION" />
+                       <xs:enumeration value="TRACE_DEBUG_LINE" />
+                       <xs:enumeration value="TRACE_DEBUG" />
+                       <xs:enumeration value="JUL_OFF" />
+                       <xs:enumeration value="JUL_SEVERE" />
+                       <xs:enumeration value="JUL_WARNING" />
+                       <xs:enumeration value="JUL_INFO" />
+                       <xs:enumeration value="JUL_CONFIG" />
+                       <xs:enumeration value="JUL_FINE" />
+                       <xs:enumeration value="JUL_FINER" />
+                       <xs:enumeration value="JUL_FINEST" />
+                       <xs:enumeration value="JUL_ALL" />
+                       <xs:enumeration value="LOG4J_OFF" />
+                       <xs:enumeration value="LOG4J_FATAL" />
+                       <xs:enumeration value="LOG4J_ERROR" />
+                       <xs:enumeration value="LOG4J_WARN" />
+                       <xs:enumeration value="LOG4J_INFO" />
+                       <xs:enumeration value="LOG4J_DEBUG" />
+                       <xs:enumeration value="LOG4J_TRACE" />
+                       <xs:enumeration value="LOG4J_ALL" />
+                       <xs:enumeration value="PYTHON_CRITICAL" />
+                       <xs:enumeration value="PYTHON_ERROR" />
+                       <xs:enumeration value="PYTHON_WARNING" />
+                       <xs:enumeration value="PYTHON_INFO" />
+                       <xs:enumeration value="PYTHON_DEBUG" />
+                       <xs:enumeration value="PYTHON_NOTSET" />
+                       <xs:enumeration value="UNKNOWN" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the lttng_calibrate_type enum -->
+       <xs:simpleType name="calibrate_type_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="FUNCTION" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the lttng_event_probe_attr struct -->
+       <xs:complexType name="event_probe_attributes_type">
+               <xs:all>
+                       <xs:element name="address" type="tns:uint64_type" minOccurs="0" />
+                       <xs:element name="offset" type="tns:uint64_type" minOccurs="0" />
+                       <xs:element name="symbol_name" type="tns:name_type" minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to the lttng_event_function_attr struct -->
+       <xs:complexType name="event_ftrace_attributes_type">
+               <xs:all>
+                       <xs:element name="symbol_name" type="tns:name_type" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to per event type configuration -->
+       <xs:complexType name="event_attributes_type">
+               <xs:choice>
+                       <xs:element name="probe_attributes" type="tns:event_probe_attributes_type" />
+                       <xs:element name="function_attributes" type="tns:event_ftrace_attributes_type" />
+               </xs:choice>
+       </xs:complexType>
+
+       <!-- Maps to exclusion type -->
+       <xs:complexType name="event_exclusion_list_type">
+               <xs:sequence>
+                       <xs:element name="exclusion" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Maps to lttng_event struct -->
+       <xs:complexType name="event_type">
+               <xs:all>
+                       <xs:element name="type" type="tns:event_type_type" default="TRACEPOINT" minOccurs="0" />
+                       <xs:element name="name" type="tns:name_type" minOccurs="0" />
+                       <xs:element name="loglevel_type" type="tns:loglevel_type" default="ALL" minOccurs="0" />
+                       <xs:element name="loglevel" type="tns:loglevel_string_type" default="" minOccurs="0" />
+                       <xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
+                       <xs:element name="filter_expression" type="xs:string" minOccurs="0" />
+                       <xs:element name="exclusions" type="tns:event_exclusion_list_type" minOccurs="0"/>
+                       <xs:element name="attributes" type="tns:event_attributes_type" minOccurs="0" />
+                       <xs:element name="event_fields" type="tns:event_fields_type" minOccurs="0" />
+                       <xs:element name="success" type="xs:boolean" minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to mi_lttng_version struct -->
+       <xs:complexType name="version_type">
+               <xs:all>
+                       <xs:element name="name" type="tns:name_type" />
+                       <xs:element name="string" type="tns:name_type" />
+                       <xs:element name="major" type="tns:uint32_type" />
+                       <xs:element name="url" type="xs:string" />
+                       <xs:element name="minor" type="tns:uint32_type" />
+                       <xs:element name="commit" type="xs:string" />
+                       <xs:element name="license" type="xs:string" />
+                       <xs:element name="patchLevel" type="tns:uint32_type" />
+                       <xs:element name="description" type="xs:string" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to an array of event -->
+       <xs:complexType name="event_list_type">
+               <xs:sequence>
+                       <xs:element name="event" type="tns:event_type" minOccurs="0" maxOccurs="unbounded" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Maps to the lttng_domain_type enum -->
+       <xs:simpleType name="domain_type_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="KERNEL"/>
+                       <xs:enumeration value="UST"/>
+                       <xs:enumeration value="JUL"/>
+                       <xs:enumeration value="LOG4J"/>
+                       <xs:enumeration value="PYTHON"/>
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the lttng_buffer_type enum -->
+       <xs:simpleType name="domain_buffer_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="PER_PID"/>
+                       <xs:enumeration value="PER_UID"/>
+                       <xs:enumeration value="GLOBAL"/>
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the type mode of a channel -->
+       <xs:simpleType name="channel_overwrite_mode_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="DISCARD" />
+                       <xs:enumeration value="OVERWRITE" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to the lttng_event_output enum -->
+       <xs:simpleType name="event_output_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="SPLICE" />
+                       <xs:enumeration value="MMAP" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- map to a pid -->
+       <xs:complexType name="pid_type">
+               <xs:all>
+                       <xs:element name="id" type="xs:int" />
+                       <xs:element name="name" type="tns:name_type" />
+                       <xs:element name="events" type="tns:event_list_type" minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- maps to an array of pid -->
+       <xs:complexType name="pids_type">
+               <xs:sequence>
+                       <xs:element name="pid" type="tns:pid_type" minOccurs="0" maxOccurs="unbounded" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <xs:simpleType name="pidbyint">
+               <xs:restriction base="xs:integer">
+                       <xs:minInclusive value="0"/>
+                       <xs:maxInclusive value="4294967295" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <xs:simpleType name="pidwildcard">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="*"/>
+               </xs:restriction>
+       </xs:simpleType>
+
+       <xs:complexType name="pid_target_type">
+               <xs:all>
+                       <xs:element name="pid">
+                               <xs:simpleType>
+                                       <xs:union memberTypes="tns:pidbyint tns:pidwildcard" />
+                               </xs:simpleType>
+                       </xs:element>
+                       <xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to a list of pid_targets-->
+       <xs:complexType name="targets_type">
+               <xs:sequence>
+                       <xs:choice>
+                               <xs:element name="pid_target" type="tns:pid_target_type" minOccurs="0" maxOccurs="unbounded"/>
+                       </xs:choice>
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Maps to a pid_tracker-->
+       <xs:complexType name="pid_tracker_type">
+               <xs:all>
+                       <xs:element name="targets" type="tns:targets_type" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to a list of trackers-->
+       <xs:complexType name="trackers_type">
+               <xs:sequence minOccurs="0" maxOccurs="unbounded">
+                       <xs:element name="pid_tracker" type="tns:pid_tracker_type" maxOccurs="1" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Maps to struct lttng_domain and contains channels -->
+       <xs:complexType name="domain_type">
+               <xs:all>
+                       <xs:element name="type" type="tns:domain_type_type" />
+                       <xs:element name="buffer_type" type="tns:domain_buffer_type" />
+                       <xs:element name="pids" type="tns:pids_type" minOccurs="0" />
+                       <xs:element name="channels" type="tns:channels_type" minOccurs="0" />
+                       <xs:element name="events" type="tns:event_list_type" minOccurs="0" />
+                       <xs:element name="trackers" type="tns:trackers_type" minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to struct lttng_channel -->
+       <xs:complexType name="channel_type">
+               <xs:all>
+                       <xs:element name="name" type="tns:name_type" />
+                       <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0" />
+                       <xs:element name="attributes" type="tns:channel_attributes_type" minOccurs="0" />
+                       <xs:element name="events" type="tns:event_list_type" minOccurs="0" />
+                       <xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to struct lttng_channel_attr -->
+       <xs:complexType name="channel_attributes_type">
+               <xs:all>
+                       <xs:element name="overwrite_mode" type="tns:channel_overwrite_mode_type" default="DISCARD" minOccurs="0" />
+                       <xs:element name="subbuffer_size" type="tns:uint64_type" minOccurs="0" /> <!-- bytes -->
+                       <xs:element name="subbuffer_count" type="tns:uint64_type" default="4" minOccurs="0" />
+                       <xs:element name="switch_timer_interval" type="tns:uint32_type" default="0" minOccurs="0" />  <!-- usec -->
+                       <xs:element name="read_timer_interval" type="tns:uint32_type" />  <!-- usec -->
+                       <xs:element name="output_type" type="tns:event_output_type" />
+                       <xs:element name="tracefile_size" type="tns:uint64_type" default="0" minOccurs="0" /> <!-- bytes -->
+                       <xs:element name="tracefile_count" type="tns:uint64_type" default="0" minOccurs="0" />
+                       <xs:element name="live_timer_interval" type="tns:uint32_type" default="0" minOccurs="0" /> <!-- usec -->
+                       <xs:element name="discarded_events" type="tns:uint64_type" default="0" minOccurs="0" />
+                       <xs:element name="lost_packets" type="tns:uint64_type" default="0" minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to struct lttng_snapshot_output -->
+       <xs:complexType name="snapshot_type">
+               <xs:all>
+                       <xs:element name="id" type="tns:uint32_type" minOccurs="0" />
+                       <xs:element name="max_size" type="tns:uint64_type" minOccurs="0" />
+                       <xs:element name="name" type="tns:name_type" minOccurs="0" />
+                       <xs:element name="session_name" type="tns:name_type" minOccurs="0" />
+                       <xs:element name="ctrl_url" type="xs:string" minOccurs="0" />
+                       <xs:element name="data_url" type="xs:string" minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+
+       <xs:complexType name="snapshots_type">
+               <xs:sequence>
+                       <xs:element name="snapshot" type="tns:snapshot_type" minOccurs="0" maxOccurs="unbounded" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <xs:complexType name="channels_type">
+               <xs:sequence>
+                       <xs:element name="channel" type="tns:channel_type" minOccurs="0" maxOccurs="unbounded" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Maps to a lttng_session -->
+       <xs:complexType name="session_type">
+               <xs:all>
+                       <xs:element name="name" type="tns:name_type" />
+                       <xs:element name="path" type="xs:string" minOccurs="0" />
+                       <xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
+                       <xs:element name="snapshot_mode" type="tns:uint32_type" minOccurs="0" />
+                       <xs:element name="live_timer_interval" type="tns:uint32_type" minOccurs="0" />
+                       <xs:element name="channels" type="tns:channels_type" minOccurs="0" />
+                       <xs:element name="domains" type="tns:domains_type" minOccurs="0" />
+                       <xs:element name="snapshots" type="tns:snapshots_type" minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to a lttng_event_field -->
+       <xs:complexType name="event_field_type">
+               <xs:all>
+                       <xs:element name="name" type="tns:name_type" />
+                       <xs:element name="type" type="tns:event_field_type_type" />
+                       <xs:element name="nowrite" type="xs:int" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to the save command -->
+       <xs:complexType name="save_type">
+               <xs:all>
+                       <xs:element name="session" type="tns:session_type" />
+                       <xs:element name="path" type="xs:string" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to the load command -->
+       <xs:complexType name="load_type">
+               <xs:all>
+                       <xs:element name="session" type="tns:session_type" />
+                       <xs:element name="path" type="xs:string" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to struct lttng_calibrate -->
+       <xs:complexType name="calibrate_type">
+               <xs:all>
+                       <xs:element name="type" type="tns:calibrate_type_type" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to lttng_event_perf_counter_ctx -->
+       <xs:complexType name="perf_counter_context_type">
+               <xs:all>
+                       <xs:element name="type" type="tns:uint32_type" />
+                       <xs:element name="config" type="tns:uint64_type" />
+                       <xs:element name="name" type="tns:name_type" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to app_ctx -->
+       <xs:complexType name="app_context_type">
+               <xs:all>
+                       <xs:element name="provider_name" type="xs:string"/>
+                       <xs:element name="ctx_name" type="xs:string"/>
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to lttng_event_context -->
+       <xs:complexType name="context_type">
+               <xs:choice>
+                       <xs:element name="type" type="tns:context_type_type"/>
+                       <xs:element name="perf" type="tns:perf_counter_context_type"/>
+                       <xs:element name="app" type="tns:app_context_type"/>
+               </xs:choice>
+       </xs:complexType>
+
+       <!-- Maps to an array of domain -->
+       <xs:complexType name="domains_type">
+               <xs:sequence>
+                       <xs:element name="domain" type="tns:domain_type" minOccurs="0" maxOccurs="unbounded" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Maps to an array of session -->
+       <xs:complexType name="sessions_type">
+               <xs:sequence>
+                       <xs:element name="session" type="tns:session_type" minOccurs="0" maxOccurs="unbounded" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Maps to an array of event_field -->
+       <xs:complexType name="event_fields_type">
+               <xs:sequence>
+                       <xs:element name="event_field" type="tns:event_field_type" minOccurs="0" maxOccurs="unbounded" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Maps to an array of context -->
+       <xs:complexType name="contexts_type">
+               <xs:sequence>
+                       <xs:element name="context" type="tns:context_type" minOccurs="0" maxOccurs="unbounded" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Maps to an action during snapshot command -->
+       <xs:complexType name="snapshot_action_type">
+               <xs:sequence>
+                       <xs:element name="name" type="tns:snapshot_actiontype_type" minOccurs="0" />
+                       <xs:element name="output" type="tns:output_type" minOccurs="0" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Type of snapshot commands -->
+       <xs:simpleType name="snapshot_actiontype_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="list-output" />
+                       <xs:enumeration value="del-output" />
+                       <xs:enumeration value="add-output" />
+                       <xs:enumeration value="record-output" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <!-- Maps to an action during metadata command -->
+       <xs:complexType name="metadata_action_type">
+               <xs:sequence>
+                       <xs:element name="name" type="tns:metadata_actiontype_type" minOccurs="0" />
+               </xs:sequence>
+       </xs:complexType>
+
+       <!-- Type of metadata commands -->
+       <xs:simpleType name="metadata_actiontype_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="regenerate" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <xs:complexType name="output_type">
+               <xs:choice>
+                       <xs:element name="domains" type="tns:domains_type" minOccurs="0" />
+                       <xs:element name="sessions" type="tns:sessions_type" minOccurs="0" />
+                       <xs:element name="session" type="tns:session_type" minOccurs="0" />
+                       <xs:element name="snapshot_action" type="tns:snapshot_action_type" minOccurs="0" />
+                       <xs:element name="snapshot" type="tns:snapshot_type" minOccurs="0" />
+                       <xs:element name="version" type="tns:version_type" minOccurs="0" />
+                       <xs:element name="save" type="tns:save_type" minOccurs="0" />
+                       <xs:element name="load" type="tns:load_type" minOccurs="0" />
+                       <xs:element name="calibrate" type="tns:calibrate_type" minOccurs="0" />
+                       <xs:element name="contexts" type="tns:contexts_type" minOccurs="0" />
+                       <xs:element name="channels" type="tns:channels_type" minOccurs="0" />
+                       <xs:element name="events" type="tns:event_list_type" minOccurs="0" />
+                       <xs:element name="channel" type="tns:channel_type" minOccurs="0" />
+                       <xs:element name="targets" type="tns:targets_type" minOccurs="0" />
+                       <xs:element name="metadata_action" type="tns:metadata_action_type" minOccurs="0" />
+               </xs:choice>
+       </xs:complexType>
+
+       <!-- Maps to the mi_lttng commands -->
+       <xs:simpleType name="command_string_type">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="create" />
+                       <xs:enumeration value="list" />
+                       <xs:enumeration value="snapshot" />
+                       <xs:enumeration value="version" />
+                       <xs:enumeration value="save" />
+                       <xs:enumeration value="load" />
+                       <xs:enumeration value="start" />
+                       <xs:enumeration value="stop" />
+                       <xs:enumeration value="destroy" />
+                       <xs:enumeration value="calibrate" />
+                       <xs:enumeration value="add-context" />
+                       <xs:enumeration value="enable-channel" />
+                       <xs:enumeration value="enable-event" />
+                       <xs:enumeration value="set-session" />
+                       <xs:enumeration value="disable-event" />
+                       <xs:enumeration value="disable-channel" />
+                       <xs:enumeration value="track" />
+                       <xs:enumeration value="untrack" />
+                       <xs:enumeration value="metadata" />
+               </xs:restriction>
+       </xs:simpleType>
+
+       <xs:element name="command">
+               <xs:complexType>
+                       <xs:all>
+                               <xs:element name="name" type="tns:command_string_type" maxOccurs="1" />
+                               <xs:element name="output" type="tns:output_type" maxOccurs="1" />
+                               <xs:element name="success" type="xs:boolean" minOccurs="0" maxOccurs="1" />
+                       </xs:all>
+                       <xs:attribute name="schemaVersion" type="xs:string" use="required"/>
+               </xs:complexType>
+       </xs:element>
+</xs:schema>
This page took 0.039368 seconds and 5 git commands to generate.