analysis: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.analysis.xml.core / src / org / eclipse / tracecompass / tmf / analysis / xml / core / module / xmlStateProvider.xsd
CommitLineData
e11e382c
FW
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- ***************************************************************************
3 * Copyright (c) 2014 École Polytechnique de Montréal
4 *
5 * All rights reserved. This program and the accompanying materials are
6 * made available under the terms of the Eclipse Public License v1.0 which
7 * accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
9 *
10 * Contributors:
11 * Florian Wininger - Initial API and implementation
12 *************************************************************************** -->
13<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
14 attributeFormDefault="unqualified" elementFormDefault="qualified">
15
e11e382c 16 <xs:complexType name="stateProvider">
85aa7575
GB
17 <xs:annotation>
18 <xs:documentation>Declares a data-driven state provider which defines how events change the state of attributes of the system. Each state provider defined in XML will become an analysis in TMF.</xs:documentation></xs:annotation>
e11e382c 19 <xs:sequence maxOccurs="1" minOccurs="1">
85aa7575
GB
20 <xs:element maxOccurs="1" minOccurs="0" name="head" type="headProvider" >
21 <xs:annotation>
22 <xs:documentation>Provide meta-information on this state provider, like labels and applicable trace types.</xs:documentation></xs:annotation></xs:element>
23 <xs:element maxOccurs="unbounded" minOccurs="0" name="definedValue" type="definedValue" >
24 <xs:annotation>
25 <xs:documentation>Define a value that maps a string used in the state provider to a numbered value.</xs:documentation></xs:annotation></xs:element>
26 <xs:element maxOccurs="unbounded" minOccurs="0" name="location" type="location" >
27 <xs:annotation>
28 <xs:documentation>Declare shortcuts to frequently used attribute/data locations. For instance, if a path to an often-used attribute is CPUs/{event.some_field}/Threads/Status, it may be a good idea to put this path in a location and then use the location name in the event handlers.</xs:documentation></xs:annotation></xs:element>
29 <xs:element maxOccurs="unbounded" minOccurs="1" name="eventHandler" type="eventHandler" >
30 <xs:annotation>
31 <xs:documentation>Define how a given event will modify the state system being built. For each event in the trace that causes a state change, a event handler should be defined.</xs:documentation></xs:annotation></xs:element>
e11e382c 32 </xs:sequence>
85aa7575
GB
33 <xs:attribute name="id" type="xs:string" use="required" >
34 <xs:annotation>
35 <xs:documentation>The unique ID of this state provider. It will be used to identify the analysis that will be built from this state provider.</xs:documentation></xs:annotation></xs:attribute>
36 <xs:attribute name="version" type="xs:integer" use="required" >
37 <xs:annotation>
38 <xs:documentation>The version ID of this state provider. Whenever the state provider changes so that the resulting state system is different from previous versions, this version number should be bumped.</xs:documentation></xs:annotation></xs:attribute>
e11e382c
FW
39 </xs:complexType>
40
41 <xs:complexType name="headProvider">
85aa7575
GB
42 <xs:annotation>
43 <xs:documentation>Declares the meta-information that can be defined for an XML state provider.</xs:documentation></xs:annotation>
e11e382c
FW
44 <xs:sequence>
45 <xs:element maxOccurs="unbounded" minOccurs="0" name="traceType">
85aa7575
GB
46 <xs:annotation>
47 <xs:documentation>Indicate that the state provider applies to a given trace type.</xs:documentation></xs:annotation>
e11e382c 48 <xs:complexType>
85aa7575
GB
49 <xs:attribute name="id" use="required" >
50 <xs:annotation>
51 <xs:documentation>The ID of the trace type, as declared in a org.eclipse.linuxtools.tmf.core.tracetype extension point or a custom trace parser. For example: "org.eclipse.linuxtools.lttng2.kernel.tracetype" or "org.eclipse.linuxtools.lttng2.ust.tracetype" for respectively LTTng Kernel and LTTng UST traces.</xs:documentation></xs:annotation></xs:attribute>
e11e382c
FW
52 </xs:complexType>
53 </xs:element>
54 <xs:element maxOccurs="1" minOccurs="0" name="label">
85aa7575
GB
55 <xs:annotation>
56 <xs:documentation>Add a label to the state provider. If provided, this text will be the name of the analysis that the user will see in TMF.</xs:documentation></xs:annotation>
e11e382c 57 <xs:complexType>
85aa7575
GB
58 <xs:attribute name="value" >
59 <xs:annotation>
60 <xs:documentation>The text to name this state provider (and the analysis it will generate).</xs:documentation></xs:annotation></xs:attribute>
e11e382c
FW
61 </xs:complexType>
62 </xs:element>
63 </xs:sequence>
64 </xs:complexType>
65
019e49cb 66 <xs:complexType name="eventHandler">
85aa7575
GB
67 <xs:annotation>
68 <xs:documentation>Define how an event modifies the state of the system. There should be one event handler for each event causing a state change.</xs:documentation></xs:annotation>
019e49cb 69 <xs:sequence>
85aa7575
GB
70 <xs:element maxOccurs="unbounded" minOccurs="1" name="stateChange" type="stateChange" >
71 <xs:annotation>
72 <xs:documentation>Define how the state system is modified by the event. An event may cause more than one state change.</xs:documentation></xs:annotation></xs:element>
019e49cb 73 </xs:sequence>
85aa7575
GB
74 <xs:attribute name="eventName" type="xs:string" use="required" >
75 <xs:annotation>
76 <xs:documentation>Name of the event that causes a state change.</xs:documentation></xs:annotation></xs:attribute>
019e49cb
FW
77 <xs:anyAttribute />
78 </xs:complexType>
79
80 <xs:complexType name="stateChange">
85aa7575
GB
81 <xs:annotation>
82 <xs:documentation>Define a change of state in the state system being built.</xs:documentation></xs:annotation>
019e49cb
FW
83 <xs:choice maxOccurs="1" minOccurs="1">
84 <xs:sequence maxOccurs="1" minOccurs="1">
85aa7575
GB
85 <xs:annotation>
86 <xs:documentation>Describe a single attribute assignation. Simply put: a state change where path/to/attribute=value.</xs:documentation></xs:annotation>
87 <xs:element maxOccurs="unbounded" minOccurs="1" name="stateAttribute" type="stateAttribute" >
88 <xs:annotation>
89 <xs:documentation>Explain how to reach an attribute in the state system. It describes the path/to/attribute.</xs:documentation></xs:annotation></xs:element>
90 <xs:element maxOccurs="1" minOccurs="1" name="stateValue" type="stateValue" >
91 <xs:annotation>
92 <xs:documentation>Explain how to obtain the value of the state attribute to modify.</xs:documentation></xs:annotation></xs:element>
019e49cb
FW
93 </xs:sequence>
94 <xs:sequence maxOccurs="1" minOccurs="1">
85aa7575
GB
95 <xs:annotation>
96 <xs:documentation>Describe a conditional state change, where different path conditions may lead to different state changes.</xs:documentation></xs:annotation>
97 <xs:element maxOccurs="1" minOccurs="1" name="if" type="conditionSingle" >
98 <xs:annotation>
99 <xs:documentation>Define the condition to verify.</xs:documentation></xs:annotation></xs:element>
100 <xs:element maxOccurs="1" minOccurs="1" name="then" type="stateChange" >
101 <xs:annotation>
102 <xs:documentation>Define the state change to use if the previous condition is true.</xs:documentation></xs:annotation></xs:element>
103 <xs:element maxOccurs="1" minOccurs="0" name="else" type="stateChange" >
104 <xs:annotation>
105 <xs:documentation>Optionally define the state change to use if the condition is false.</xs:documentation></xs:annotation></xs:element>
019e49cb
FW
106 </xs:sequence>
107 </xs:choice>
108 </xs:complexType>
109
110 <xs:complexType name="condition">
85aa7575
GB
111 <xs:annotation>
112 <xs:documentation>Define a conditional statement. Conditions may use values of the state system or from the event being handled. This element defines a statement in the form of "if (some_path == value)".</xs:documentation></xs:annotation>
019e49cb
FW
113 <xs:sequence maxOccurs="1" minOccurs="1">
114 <xs:choice maxOccurs="1" minOccurs="1">
85aa7575
GB
115 <xs:element maxOccurs="unbounded" minOccurs="1" name="stateAttribute" type="stateAttribute" >
116 <xs:annotation>
117 <xs:documentation>Compare the current value of an attribute of the state system.</xs:documentation></xs:annotation></xs:element>
118 <xs:element maxOccurs="1" minOccurs="1" name="field" type="eventField" >
119 <xs:annotation>
120 <xs:documentation>Compare the value of an event field.</xs:documentation></xs:annotation></xs:element>
019e49cb 121 </xs:choice>
85aa7575
GB
122 <xs:element maxOccurs="1" minOccurs="1" name="stateValue" type="stateValue" >
123 <xs:annotation>
124 <xs:documentation>Define the value to compare to.</xs:documentation></xs:annotation></xs:element>
019e49cb 125 </xs:sequence>
5ddeee68
NE
126
127 <xs:attribute name="operator" default="eq">
128 <xs:annotation>
129 <xs:documentation>Indicate that a comparison operation will be performed with the value</xs:documentation></xs:annotation>
130 <xs:simpleType>
131 <xs:restriction base="xs:string">
132 <xs:enumeration value="eq">
133 <xs:annotation>
134 <xs:documentation>The operation type is to check if two values are equal</xs:documentation></xs:annotation></xs:enumeration>
135 <xs:enumeration value="ne">
136 <xs:annotation>
137 <xs:documentation>The operation type is to check if two values are not equal</xs:documentation></xs:annotation></xs:enumeration>
138 <xs:enumeration value="ge">
139 <xs:annotation>
140 <xs:documentation>The operation type is to check if the first value is greater than or equal the second one</xs:documentation></xs:annotation></xs:enumeration>
141 <xs:enumeration value="gt">
142 <xs:annotation>
143 <xs:documentation>The operation type is to check if the first value is greater than the second one</xs:documentation></xs:annotation></xs:enumeration>
144 <xs:enumeration value="le">
145 <xs:annotation>
146 <xs:documentation>The operation type is to check if the first value is smaller than or equal the second one</xs:documentation></xs:annotation></xs:enumeration>
147 <xs:enumeration value="lt">
148 <xs:annotation>
149 <xs:documentation>The operation type is to check if the first value is smaller than the second one</xs:documentation></xs:annotation></xs:enumeration>
150 </xs:restriction>
151 </xs:simpleType>
152 </xs:attribute>
153
019e49cb
FW
154 </xs:complexType>
155
156 <xs:complexType name="conditionSingle">
85aa7575
GB
157 <xs:annotation>
158 <xs:documentation>Define a conditional statement with only one child. From this element, a condition may be composed of other conditional elements to create more complex conditional statements.</xs:documentation></xs:annotation>
019e49cb 159 <xs:choice maxOccurs="1" minOccurs="1">
85aa7575
GB
160 <xs:element name="condition" type="condition" >
161 <xs:annotation>
162 <xs:documentation>Define a condition element, in the form "if (some_path == value)".</xs:documentation></xs:annotation></xs:element>
163 <xs:element name="not" type="conditionSingle" >
164 <xs:annotation>
165 <xs:documentation>Negate the result of the following condition, allowing statements of the form "if (!cond)".</xs:documentation></xs:annotation></xs:element>
166 <xs:element name="and" type="conditionMultiple" >
167 <xs:annotation>
168 <xs:documentation>ANDs 2 conditional statements, allowing statements of the form "if (condA AND condB)"</xs:documentation></xs:annotation></xs:element>
169 <xs:element name="or" type="conditionMultiple" >
170 <xs:annotation>
171 <xs:documentation>ORs 2 conditional statements, allowing statements of the form "if (condA OR condB)"</xs:documentation></xs:annotation></xs:element>
019e49cb
FW
172 </xs:choice>
173 <xs:anyAttribute />
174 </xs:complexType>
175
176 <xs:complexType name="conditionMultiple">
85aa7575
GB
177 <xs:annotation>
178 <xs:documentation>Allows the composition of more than one conditional statements.</xs:documentation></xs:annotation>
019e49cb 179 <xs:sequence maxOccurs="unbounded" minOccurs="1">
85aa7575
GB
180 <xs:element maxOccurs="1" minOccurs="0" name="condition" type="condition" >
181 <xs:annotation>
182 <xs:documentation>Define a condition element, in the form "if (some_path == value)".</xs:documentation></xs:annotation></xs:element>
183 <xs:element maxOccurs="1" minOccurs="0" name="or" type="conditionMultiple" >
184 <xs:annotation>
185 <xs:documentation>ORs 2 conditional statements, allowing statements of the form "if (condA OR condB)"</xs:documentation></xs:annotation></xs:element>
186 <xs:element maxOccurs="1" minOccurs="0" name="and" type="conditionMultiple" >
187 <xs:annotation>
188 <xs:documentation>ANDs 2 conditional statements, allowing statements of the form "if (condA AND condB)"</xs:documentation></xs:annotation></xs:element>
189 <xs:element maxOccurs="1" minOccurs="0" name="not" type="conditionSingle" >
190 <xs:annotation>
191 <xs:documentation>Negate the result of the following condition, allowing statements of the form "if (!cond)".</xs:documentation></xs:annotation></xs:element>
019e49cb
FW
192 </xs:sequence>
193 <xs:anyAttribute />
194 </xs:complexType>
195
196 <xs:complexType name="stateAttribute">
85aa7575
GB
197 <xs:annotation>
198 <xs:documentation>Define a path to an attribute of the state system.</xs:documentation></xs:annotation>
019e49cb 199 <xs:sequence>
85aa7575
GB
200 <xs:element maxOccurs="unbounded" minOccurs="0" name="stateAttribute" type="stateAttribute" >
201 <xs:annotation>
202 <xs:documentation>If the type is a "query", those stateAttribute elements describe the elements of the query.</xs:documentation></xs:annotation></xs:element>
019e49cb
FW
203 </xs:sequence>
204 <xs:attribute name="type" use="required">
85aa7575
GB
205 <xs:annotation>
206 <xs:documentation>The type of path to this attribute. The meaning of those paths type will depend on the context where the stateAttribute is being used. Not all types will make sense everywhere.</xs:documentation></xs:annotation>
019e49cb
FW
207 <xs:simpleType>
208 <xs:restriction base="xs:string">
85aa7575
GB
209 <xs:enumeration value="null" >
210 <xs:annotation>
211 <xs:documentation>This type does not change the current attribute. Whatever attribute was the reference attribute at a given time, it will be returned as is.</xs:documentation></xs:annotation></xs:enumeration>
212 <xs:enumeration value="constant" >
213 <xs:annotation>
214 <xs:documentation>This type identifies the state system attribute by a constant string. For instance, if the first level attribute of the state system is "Threads", then a constant type with "Threads" value should be used.</xs:documentation></xs:annotation></xs:enumeration>
215 <xs:enumeration value="eventField" >
216 <xs:annotation>
217 <xs:documentation>This type identifies the attribute by the value of an event field. Note that the event field corresponds to the attribute name, not its value. For example, if the event has a field called "current_cpu" with a value of "2", "2" would be the attribute name we want.</xs:documentation></xs:annotation></xs:enumeration>
597168fc
NE
218 <xs:enumeration value="eventName" >
219 <xs:annotation>
220 <xs:documentation>This type identifies the attribute as the name of an event.</xs:documentation></xs:annotation></xs:enumeration>
85aa7575
GB
221 <xs:enumeration value="location" >
222 <xs:annotation>
223 <xs:documentation>This type indicates that the path to the attribute is at the specified location. Location simply avoids having to write full path to an attribute each time it is being used, but the location itself is a sequence of stateAttribute elements. For example, if we previously defined a location named "CurrentThead" for path "CPUs/{current_cpu}/CurrentThread", we can use a stateAttribute of type location with "CurrentThread" value.</xs:documentation></xs:annotation></xs:enumeration>
224 <xs:enumeration value="query" >
225 <xs:annotation>
226 <xs:documentation>This type indicates that the path to the attribute is the result of a query. If this type is selected, a sequence of stateAttribute elements needs to be specified for this state attribute. The result of the query is the attribute name of the current element. For example, if the attribute we want is the PID of the current process on CPU 0, that PID can be found through the query "CPUs/0/CurrentThread". The value of this attribute would be, for example, 1234, the attribute we are looking for.</xs:documentation></xs:annotation></xs:enumeration>
019e49cb
FW
227 </xs:restriction>
228 </xs:simpleType>
229 </xs:attribute>
85aa7575
GB
230 <xs:attribute name="value" type="xs:string" >
231 <xs:annotation>
232 <xs:documentation>The value of this state attribute. A value should be specified only if the type is "constant", "eventField" or "location".</xs:documentation></xs:annotation></xs:attribute>
019e49cb
FW
233 </xs:complexType>
234
235 <xs:complexType name="stateValue">
85aa7575
GB
236 <xs:annotation>
237 <xs:documentation>Define a value, that can be assigned to an attribute of the state system.</xs:documentation></xs:annotation>
019e49cb 238 <xs:sequence>
85aa7575
GB
239 <xs:annotation>
240 <xs:documentation>For a "query" value type, a sequence of stateAttributes will define the query whose result is the value.</xs:documentation></xs:annotation>
241 <xs:element maxOccurs="unbounded" minOccurs="0" name="stateAttribute" type="stateAttribute" ></xs:element>
019e49cb
FW
242 </xs:sequence>
243 <xs:attribute name="type" use="required">
85aa7575
GB
244 <xs:annotation>
245 <xs:documentation>The type of this state value. It will describe how to obtain to value and/or what to do with it.</xs:documentation></xs:annotation>
019e49cb
FW
246 <xs:simpleType>
247 <xs:restriction base="xs:string">
85aa7575
GB
248 <xs:enumeration value="null" >
249 <xs:annotation>
250 <xs:documentation>Indicate that the value is a null value.</xs:documentation></xs:annotation></xs:enumeration>
251 <xs:enumeration value="int" >
252 <xs:annotation>
253 <xs:documentation>The value is a constant of type integer.</xs:documentation></xs:annotation></xs:enumeration>
254 <xs:enumeration value="long" >
255 <xs:annotation>
256 <xs:documentation>The value is a constant of type long</xs:documentation></xs:annotation></xs:enumeration>
257 <xs:enumeration value="string" >
258 <xs:annotation>
259 <xs:documentation>The value is a constant of type string</xs:documentation></xs:annotation></xs:enumeration>
260 <xs:enumeration value="eventField" >
261 <xs:annotation>
262 <xs:documentation>The value is the content of an event field. The "value" attribute is the field name. To convert this field to a certain type, attribute "forcedType" may be used.</xs:documentation></xs:annotation></xs:enumeration>
263 <xs:enumeration value="eventName" >
264 <xs:annotation>
265 <xs:documentation>The value is the name of the event.</xs:documentation></xs:annotation></xs:enumeration>
266 <xs:enumeration value="delete" >
267 <xs:annotation>
268 <xs:documentation>Indicate that the attribute the value is to be applied to should be deleted.</xs:documentation></xs:annotation></xs:enumeration>
269 <xs:enumeration value="query" >
270 <xs:annotation>
271 <xs:documentation>The value is the result of a query to the state system. If this type is selected, a sequence of stateAttributes must be defined in this stateValue element.</xs:documentation></xs:annotation></xs:enumeration>
019e49cb
FW
272 </xs:restriction>
273 </xs:simpleType>
274 </xs:attribute>
85aa7575
GB
275 <xs:attribute name="increment" type="xs:boolean" >
276 <xs:annotation>
277 <xs:documentation>Indicate that the current value will be added to any previously available value.</xs:documentation></xs:annotation></xs:attribute>
019e49cb 278 <xs:attribute name="stack">
85aa7575
GB
279 <xs:annotation>
280 <xs:documentation>Indicate that a stack operation will be performed with the value</xs:documentation></xs:annotation>
019e49cb
FW
281 <xs:simpleType>
282 <xs:restriction base="xs:string">
85aa7575
GB
283 <xs:enumeration value="pop">
284 <xs:annotation>
285 <xs:documentation>The value will be popped from the stack</xs:documentation></xs:annotation></xs:enumeration>
286 <xs:enumeration value="push">
287 <xs:annotation>
288 <xs:documentation>The value will be pushed on a stack</xs:documentation></xs:annotation></xs:enumeration>
289 <xs:enumeration value="peek">
290 <xs:annotation>
291 <xs:documentation>The value will be peeked from the top of the stack, but it will stay there</xs:documentation></xs:annotation></xs:enumeration>
019e49cb
FW
292 </xs:restriction>
293 </xs:simpleType>
294 </xs:attribute>
295 <xs:attribute name="forcedType">
85aa7575
GB
296 <xs:annotation>
297 <xs:documentation>Indicate the desired type for the state value. If the value is not already of this type, a conversion will be attempted. The forcedType is used to convert values of event fields.</xs:documentation></xs:annotation>
019e49cb
FW
298 <xs:simpleType>
299 <xs:restriction base="xs:string">
85aa7575
GB
300 <xs:enumeration value="int" >
301 <xs:annotation>
302 <xs:documentation>The value should be an integer</xs:documentation></xs:annotation></xs:enumeration>
303 <xs:enumeration value="long" >
304 <xs:annotation>
305 <xs:documentation>The value should be a long</xs:documentation></xs:annotation></xs:enumeration>
306 <xs:enumeration value="string" >
307 <xs:annotation>
308 <xs:documentation>The value should be a double</xs:documentation></xs:annotation></xs:enumeration>
019e49cb
FW
309 </xs:restriction>
310 </xs:simpleType>
311 </xs:attribute>
85aa7575
GB
312 <xs:attribute name="value" type="xs:string" >
313 <xs:annotation>
314 <xs:documentation>Indicate what the value is. A value should be specified only if the type is int, long, string or event_field. See the documentation on types for information on what to put for value.</xs:documentation></xs:annotation></xs:attribute>
019e49cb
FW
315 </xs:complexType>
316
317 <xs:complexType name="eventField">
85aa7575
GB
318 <xs:annotation>
319 <xs:documentation>This element is used in conditions where the value of an event field is compared to something else. It is not the same as the stateAttribute's type eventField, where the eventField is used as the name for an attribute to the state system.</xs:documentation></xs:annotation>
320 <xs:attribute name="name" type="xs:string" use="required" >
321 <xs:annotation>
322 <xs:documentation>Indicate which field to use.</xs:documentation></xs:annotation></xs:attribute>
019e49cb
FW
323 </xs:complexType>
324
85aa7575 325</xs:schema>
This page took 0.069105 seconds and 5 git commands to generate.