tmf : Move preconditions at the same level as states in the XML file
authorJean-Christian Kouame <jean-christian.kouame@ericsson.com>
Fri, 8 Apr 2016 19:20:45 +0000 (15:20 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Thu, 14 Apr 2016 19:21:42 +0000 (15:21 -0400)
Change-Id: Ib4a6c59d841831d4b91298970cda039272149e04
Signed-off-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/70292
Reviewed-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/test_xml_files/test_valid/test_valid_pattern.xml
tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/module/xmlPatternStateProvider.xsd

index f031a8d79c747534c402421432d154190b172e49..90700c69faff5a302218048b36d0616e91162133 100644 (file)
                <stateAttribute type="constant" value="CPUs" />
                <stateAttribute type="eventField" value="cpu" />
        </location>
-<!-- Shortcut for the current scenario -->
-       <location id="CurrentScenario">
-               <stateAttribute type="constant" value="pattern" />
-               <stateAttribute type="constant" value="scenarios" />
-               <stateAttribute type="constant" value="#scenarioName" />
-       </location>
 
 <!--   The attribute initial specifies the FSMs that will be instanciated at the beginning of the analysis -->
        <patternHandler initial="sched_switch:syscall">
@@ -95,7 +89,7 @@
                                                <stateAttribute type="constant" value="Current_thread" />
                                        </stateValue>
                                        <stateValue type="query">
-                                               <stateAttribute type="location" value="CurrentScenario" />
+                                               <stateAttribute type="constant" value="#CurrentScenario" />
                                                <stateAttribute type="constant" value="thread" />
                                        </stateValue>
                                </condition>
                <action id="sys_x_founded">
 <!--           Save the name of the system call executed under the current scenario path-->
                        <stateChange>
-                               <stateAttribute type="location" value="CurrentScenario" />
+                               <stateAttribute type="constant" value="#CurrentScenario" />
                                <stateAttribute type="constant" value="syscall" />
                                <stateAttribute type="constant" value="name" />
                                <stateValue type="eventName"/>
                        </stateChange>
 <!--           Save the value of the CPU under the current scenario path -->
                        <stateChange>
-                               <stateAttribute type="location" value="CurrentScenario" />
+                               <stateAttribute type="constant" value="#CurrentScenario" />
                                <stateAttribute type="constant" value="cpu" />
                                <stateValue type="eventField" value="cpu"/>
                        </stateChange>
 <!--           Save the value of the current thread PID under the current scenario path -->
                        <stateChange>
-                               <stateAttribute type="location" value="CurrentScenario" />
+                               <stateAttribute type="constant" value="#CurrentScenario" />
                                <stateAttribute type="constant" value="thread" />
                                <stateValue type="query">
                                        <stateAttribute type="location" value="CurrentCPU" />
                                <segType>
                                        <segName>
                                                <stateValue type="query">
-                                                       <stateAttribute type="location" value="CurrentScenario" />
+                                                       <stateAttribute type="constant" value="#CurrentScenario" />
                                                        <stateAttribute type="constant" value="syscall" />
                                                        <stateAttribute type="constant" value="name" />
                                                </stateValue>
 -->
                <fsm id="sched_switch" multiple="false">
 <!--           if event.name != sched_switch, no processing will be done -->
+                       <precondition event="sched_switch"/>
                        <initial>
                                <transition target="sched_switch"/>
-                               <precondition event="sched_switch"/>
                        </initial>
                        <state id="sched_switch">
 <!--                                   The state will stay here forever and execute the action "update current thread" each time a sched_switch event will be meet-->
index de2d4ecd64233c08e2c5d56e144f296006f0c73d..9a41c44bf2f8ca63b834056ffb30ad69f7531703 100644 (file)
                        <xs:element maxOccurs="unbounded" minOccurs="1" name="transition" type="transition">
                                <xs:annotation>
                                        <xs:documentation>Declares a transition for the state.</xs:documentation></xs:annotation></xs:element>
-                       <xs:element maxOccurs="unbounded" minOccurs="0" name="precondition" type="transition">
-                               <xs:annotation>
-                                       <xs:documentation>Declares a precondition for this fsm. At least one of the preconditions needs to be validated before being able to activate process the fsm. A precondition is a transition with no target or action. It should contains only conditions that needs to be validated.</xs:documentation></xs:annotation></xs:element>
                </xs:sequence>
        </xs:complexType>
 
                        <xs:element maxOccurs="1" minOccurs="0" name="onexit" type="handlers">
                                <xs:annotation>
                                        <xs:documentation>Declares a list of actions to execute when exiting the complex state.</xs:documentation></xs:annotation></xs:element>
+                       <xs:element maxOccurs="unbounded" minOccurs="0" name="precondition" type="transition">
+                               <xs:annotation>
+                                       <xs:documentation>Declares a precondition for this fsm. At least one of the preconditions needs to be validated before being able to activate process the fsm. A precondition is a special transition with no target or action. It should contains only conditions that needs to be validated. Only used for fsm.</xs:documentation></xs:annotation></xs:element>
                        <xs:element maxOccurs="1" minOccurs="0" name="initial" type="initialState">
                                <xs:annotation>
                                        <xs:documentation>Declares the default initial state of this complex state. Must not be specified for an atomic state</xs:documentation></xs:annotation></xs:element>
This page took 0.027605 seconds and 5 git commands to generate.