aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Wininger2014-03-10 15:35:19 (EDT)
committerGenevieve Bastien2014-04-04 09:27:12 (EDT)
commit21757defc733806d44a8bcda9eac29e889f12b4b (patch)
tree91bfdf65da0e8f100dadf37ccc6f8cc9c7c95da0
parentab8d1deec3802902db60c70f38065b31021fcd39 (diff)
downloadorg.eclipse.linuxtools-21757defc733806d44a8bcda9eac29e889f12b4b.zip
org.eclipse.linuxtools-21757defc733806d44a8bcda9eac29e889f12b4b.tar.gz
org.eclipse.linuxtools-21757defc733806d44a8bcda9eac29e889f12b4b.tar.bz2
TMF: Add XML state system view definition to the XSDrefs/changes/59/23159/7
Change-Id: I3cad7bd42b2b263837b62392b5169781c5f9b26a Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Signed-off-by: Florian Wininger <florian.wininger@polymtl.ca> Reviewed-on: https://git.eclipse.org/r/23159 Tested-by: Hudson CI
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/common/org/eclipse/linuxtools/tmf/analysis/xml/core/tests/common/TmfXmlTestFiles.java2
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/src/org/eclipse/linuxtools/tmf/analysis/xml/core/tests/module/XmlUtilsTest.java15
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid/invalid_view_multipledisplays.xml35
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid/test_invalid.xml (renamed from lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid.xml)0
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_valid.xml29
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/module/xmlDefinition.xsd2
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/module/xmlStateSystemView.xsd76
7 files changed, 158 insertions, 1 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/common/org/eclipse/linuxtools/tmf/analysis/xml/core/tests/common/TmfXmlTestFiles.java b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/common/org/eclipse/linuxtools/tmf/analysis/xml/core/tests/common/TmfXmlTestFiles.java
index 2274bd8..5a48ce3 100644
--- a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/common/org/eclipse/linuxtools/tmf/analysis/xml/core/tests/common/TmfXmlTestFiles.java
+++ b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/common/org/eclipse/linuxtools/tmf/analysis/xml/core/tests/common/TmfXmlTestFiles.java
@@ -23,7 +23,7 @@ public enum TmfXmlTestFiles {
/** A valid XML test file */
VALID_FILE("../org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_valid.xml"),
/** An invalid test file */
- INVALID_FILE("../org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid.xml");
+ INVALID_FILE("../org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid/test_invalid.xml");
private final String fPath;
diff --git a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/src/org/eclipse/linuxtools/tmf/analysis/xml/core/tests/module/XmlUtilsTest.java b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/src/org/eclipse/linuxtools/tmf/analysis/xml/core/tests/module/XmlUtilsTest.java
index fffe192..5867aa5 100644
--- a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/src/org/eclipse/linuxtools/tmf/analysis/xml/core/tests/module/XmlUtilsTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/src/org/eclipse/linuxtools/tmf/analysis/xml/core/tests/module/XmlUtilsTest.java
@@ -40,6 +40,8 @@ import org.w3c.dom.Element;
*/
public class XmlUtilsTest {
+ private static final String pathname = "test_xml_files/test_invalid";
+
/**
* Empty the XML directory after the test
*/
@@ -91,9 +93,22 @@ public class XmlUtilsTest {
fail("XML test file does not exist");
}
assertFalse(XmlUtils.xmlValidate(testXmlFile).isOK());
+
}
/**
+ * Test various invalid files and make sure they are invalid
+ */
+ @Test
+ public void testXmlValidateInvalid() {
+ File[] validFiles = (new File(pathname)).listFiles();
+ for (File f : validFiles) {
+ assertFalse("File " + f.getName(), XmlUtils.xmlValidate(f).isOK());
+ }
+ }
+
+
+ /**
* test the {@link XmlUtils#addXmlFile(File)} method
*/
@Test
diff --git a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid/invalid_view_multipledisplays.xml b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid/invalid_view_multipledisplays.xml
new file mode 100644
index 0000000..bf820ea
--- /dev/null
+++ b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid/invalid_view_multipledisplays.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ***************************************************************************
+* Copyright (c) 2014 École Polytechnique de Montréal
+*
+* All rights reserved. This program and the accompanying materials are
+* made available under the terms of the Eclipse Public License v1.0 which
+* accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* Geneviève Bastien - Initial API and implementation
+*************************************************************************** -->
+<tmfxml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="xmlDefinition.xsd">
+
+ <stateSystemView id="org.eclipse.linuxtools.tmf.analysis.xml.ui.views.statesystem">
+ <head>
+ <analysis id="kernel.linux.sp" />
+ <label value="Xml kernel View" />
+ </head>
+ <!-- StateValues -->
+ <definedValue name="PROCESS_STATUS_UNKNOWN" value="0" color="#EEEEEE" />
+ <definedValue name="PROCESS_STATUS_WAIT_BLOCKED" value="1" color="#CCCCCC" />
+ <definedValue name="PROCESS_STATUS_RUN_USERMODE" value="2" color="#118811" />
+ <definedValue name="PROCESS_STATUS_RUN_SYSCALL" value="3" color="#0000EE" />
+ <definedValue name="PROCESS_STATUS_INTERRUPTED" value="4" color="#DDDD00" />
+ <definedValue name="PROCESS_STATUS_WAIT_FOR_CPU" value="5" color="#AA0000" />
+
+ <!-- Control Flow View -->
+ <entry path="CPUs/*">
+ <display type="self" />
+ <display type="constant" value="a" />
+ </entry>
+ </stateSystemView>
+</tmfxml> \ No newline at end of file
diff --git a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid.xml b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid/test_invalid.xml
index dcd5512..dcd5512 100644
--- a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid.xml
+++ b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_invalid/test_invalid.xml
diff --git a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_valid.xml b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_valid.xml
index 4c82107..4691177 100644
--- a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_valid.xml
+++ b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core.tests/test_xml_files/test_valid.xml
@@ -13,6 +13,35 @@
<tmfxml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="xmlDefinition.xsd">
+ <stateSystemView id="org.eclipse.linuxtools.tmf.analysis.xml.ui.views.statesystem">
+ <head>
+ <analysis id="kernel.linux.sp" />
+ <label value="Xml Sample Kernel View" />
+ </head>
+ <!-- StateValues -->
+ <definedValue name="PROCESS_STATUS_UNKNOWN" value="0" color="#EEEEEE" />
+ <definedValue name="PROCESS_STATUS_WAIT_BLOCKED" value="1" color="#CCCCCC" />
+ <definedValue name="PROCESS_STATUS_RUN_USERMODE" value="2" color="#118811" />
+ <definedValue name="PROCESS_STATUS_RUN_SYSCALL" value="3" color="#0000EE" />
+ <definedValue name="PROCESS_STATUS_INTERRUPTED" value="4" color="#DDDD00" />
+ <definedValue name="PROCESS_STATUS_WAIT_FOR_CPU" value="5" color="#AA0000" />
+
+ <!-- Control Flow View -->
+ <entry path="CPUs/*">
+ <display type="constant" value="Status" />
+ <parent type="constant" value="PPID" />
+ <name type="constant" value="Exec_name" />
+ </entry>
+ <entry path="Threads">
+ <display type="self" />
+ <entry path="*">
+ <display type="constant" value="Status" />
+ <parent type="constant" value="PPID" />
+ <name type="constant" value="Exec_name" />
+ </entry>
+ </entry>
+ </stateSystemView>
+
<stateProvider id="kernel.linux.sp" version="1">
<head>
<traceType id="org.eclipse.linuxtools.lttng2.kernel.tracetype" />
diff --git a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/module/xmlDefinition.xsd b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/module/xmlDefinition.xsd
index f464c1d..1783836 100644
--- a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/module/xmlDefinition.xsd
+++ b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/module/xmlDefinition.xsd
@@ -15,9 +15,11 @@
<xs:include schemaLocation="xmlCommon.xsd" />
<xs:include schemaLocation="xmlStateProvider.xsd" />
+ <xs:include schemaLocation="xmlStateSystemView.xsd" />
<xs:element name="tmfxml">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="stateSystemView" type="stateSystemView" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="stateProvider" type="stateProvider" />
</xs:choice>
</xs:complexType>
diff --git a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/module/xmlStateSystemView.xsd b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/module/xmlStateSystemView.xsd
new file mode 100644
index 0000000..7064a9a
--- /dev/null
+++ b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/module/xmlStateSystemView.xsd
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- ***************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Florian Wininger - Initial API and implementation
+ *************************************************************************** -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ attributeFormDefault="unqualified" elementFormDefault="qualified">
+
+ <xs:complexType name="stateSystemView">
+ <xs:sequence>
+ <xs:element maxOccurs="1" minOccurs="0" name="head" type="headOutput" />
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="definedValue" type="definedValue" />
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="entry" type="viewEntry" />
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string" use="required" />
+ </xs:complexType>
+
+ <xs:complexType name="headOutput">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="analysis">
+ <xs:complexType>
+ <xs:attribute name="id" type="xs:string" use="required" />
+ <xs:attribute name="ssid" type="xs:string" use="optional" />
+ </xs:complexType>
+ </xs:element>
+ <xs:element maxOccurs="1" minOccurs="0" name="label">
+ <xs:complexType>
+ <xs:attribute name="value" use="required" />
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="viewEntry">
+ <xs:sequence>
+ <xs:element maxOccurs="1" minOccurs="0" name="display" type="viewStateAttribute" />
+ <xs:element maxOccurs="1" minOccurs="0" name="id" type="viewStateAttribute" />
+ <xs:element maxOccurs="1" minOccurs="0" name="parent" type="viewStateAttribute" />
+ <xs:element maxOccurs="1" minOccurs="0" name="name" type="viewStateAttribute" />
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="entry" type="viewEntry" />
+ </xs:sequence>
+ <xs:attribute name="path" type="xs:string" use="required" />
+ </xs:complexType>
+
+ <xs:complexType name="viewStateAttribute">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="stateAttribute" type="stateAttribute" />
+ </xs:sequence>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="constant" />
+ <xs:enumeration value="location" />
+ <xs:enumeration value="query" />
+ <xs:enumeration value="self" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="value" type="xs:string" />
+ <xs:attribute name="reference" use="optional" default="relative">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="relative" />
+ <xs:enumeration value="absolute" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+</xs:schema> \ No newline at end of file