Mi: mi xsd validation
[lttng-tools.git] / src / common / mi_lttng.xsd
CommitLineData
c5e38b74
JR
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3Copyright (c) 2014 - Oliver Cotte <olivier.cotte@polymtl.ca>
4 - Jonathan Rajotte <jonathan.r.julien@gmail.com>
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22THE SOFTWARE.
23-->
24<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
25 elementFormDefault="qualified" version="2.5">
26
27 <!-- Maps to the uint32_t type -->
28 <xs:simpleType name="uint32_type">
29 <xs:restriction base="xs:integer">
30 <xs:minInclusive value="0" />
31 <xs:maxInclusive value="4294967295" />
32 </xs:restriction>
33 </xs:simpleType>
34
35 <!-- Maps to the uint64_t type -->
36 <xs:simpleType name="uint64_type">
37 <xs:restriction base="xs:integer">
38 <xs:minInclusive value="0" />
39 <xs:maxInclusive value="18446744073709551615" />
40 </xs:restriction>
41 </xs:simpleType>
42
43 <!-- Maps to the char name[LTTNG_SYMBOL_NAME_LEN] -->
44 <xs:simpleType name="name_type">
45 <xs:restriction base="xs:string">
46 <xs:maxLength value="255" />
47 </xs:restriction>
48 </xs:simpleType>
49
50 <!-- Maps to the lttng_event_type enum -->
51 <xs:simpleType name="event_type_type">
52 <xs:restriction base="xs:string">
53 <xs:enumeration value="ALL" />
54 <xs:enumeration value="TRACEPOINT" />
55 <xs:enumeration value="PROBE" />
56 <xs:enumeration value="FUNCTION" />
57 <xs:enumeration value="FUNCTION_ENTRY" />
58 <xs:enumeration value="NOOP" />
59 <xs:enumeration value="SYSCALL" />
60 <xs:enumeration value="KPROBE" />
61 <xs:enumeration value="KRETPROBE" />
62 </xs:restriction>
63 </xs:simpleType>
64
65 <!-- Maps to the lttng_event_field_type enum -->
66 <xs:simpleType name="event_field_type_type">
67 <xs:restriction base="xs:string">
68 <xs:enumeration value="OTHER" />
69 <xs:enumeration value="INTEGER" />
70 <xs:enumeration value="ENUM" />
71 <xs:enumeration value="FLOAT" />
72 <xs:enumeration value="STRING" />
73 </xs:restriction>
74 </xs:simpleType>
75
76 <!-- Maps to the lttng_loglevel_type enum -->
77 <xs:simpleType name="loglevel_type">
78 <xs:restriction base="xs:string">
79 <xs:enumeration value="ALL" />
80 <xs:enumeration value="RANGE" />
81 <xs:enumeration value="SINGLE" />
82 <xs:enumeration value="UNKNOWN" />
83 </xs:restriction>
84 </xs:simpleType>
85
86 <!-- Maps to loglevel_string char * -->
87 <xs:simpleType name="loglevel_string_type">
88 <xs:restriction base="xs:string">
89 <xs:enumeration value="" />
90 <xs:enumeration value="TRACE_EMERG" />
91 <xs:enumeration value="TRACE_ALERT" />
92 <xs:enumeration value="TRACE_CRIT" />
93 <xs:enumeration value="TRACE_ERR" />
94 <xs:enumeration value="TRACE_WARNING" />
95 <xs:enumeration value="TRACE_NOTICE" />
96 <xs:enumeration value="TRACE_INFO" />
97 <xs:enumeration value="TRACE_DEBUG_SYSTEM" />
98 <xs:enumeration value="TRACE_DEBUG_PROGRAM" />
99 <xs:enumeration value="TRACE_DEBUG_PROCESS" />
100 <xs:enumeration value="TRACE_DEBUG_MODULE" />
101 <xs:enumeration value="TRACE_DEBUG_UNIT" />
102 <xs:enumeration value="TRACE_DEBUG_FUNCTION" />
103 <xs:enumeration value="TRACE_DEBUG_LINE" />
104 <xs:enumeration value="TRACE_DEBUG" />
105 <xs:enumeration value="UNKNOWN" />
106 </xs:restriction>
107 </xs:simpleType>
108
109 <!-- Maps to the lttng_event_probe_attr struct -->
110 <xs:complexType name="event_probe_attributes_type">
111 <xs:all>
112 <xs:element name="address" type="uint64_type" />
113 <xs:element name="offset" type="uint64_type" />
114 <xs:element name="symbol_name" type="name_type" />
115 </xs:all>
116 </xs:complexType>
117
118 <!-- Maps to the lttng_event_function_attr struct -->
119 <xs:complexType name="event_ftrace_attributes_type">
120 <xs:all>
121 <xs:element name="symbol_name" type="name_type" />
122 </xs:all>
123 </xs:complexType>
124
125 <!-- Maps to per event type configuration -->
126 <xs:complexType name="event_attributes_type">
127 <xs:choice>
128 <xs:element name="probe_attributes" type="event_probe_attributes_type" />
129 <xs:element name="function_attributes" type="event_ftrace_attributes_type" />
130 </xs:choice>
131 </xs:complexType>
132
133 <!-- Maps to lttng_event struct -->
134 <xs:complexType name="event_type">
135 <xs:all>
136 <xs:element name="type" type="event_type_type" default="TRACEPOINT" minOccurs="0" />
137 <xs:element name="name" type="name_type" minOccurs="0" />
138 <xs:element name="loglevel_type" type="loglevel_type" default="ALL" minOccurs="0" />
139 <xs:element name="loglevel" type="loglevel_string_type" default="" minOccurs="0" />
140 <xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
141 <xs:element name="filter" type="xs:boolean" minOccurs="0" />
142 <xs:element name="exclusion" type="xs:boolean" minOccurs="0" />
143 <xs:element name="attributes" type="event_attributes_type" minOccurs="0" />
144 <xs:element name="event_fields" type="event_fields_type" minOccurs="0" />
145 </xs:all>
146 </xs:complexType>
147
148 <!-- Maps to mi_lttng_version struct -->
149 <xs:complexType name="version_type">
150 <xs:all>
151 <xs:element name="name" type="name_type" />
152 <xs:element name="string" type="name_type" />
153 <xs:element name="major" type="uint32_type" />
154 <xs:element name="url" type="xs:string" />
155 <xs:element name="minor" type="uint32_type" />
156 <xs:element name="license" type="xs:string" />
157 <xs:element name="patchLevel" type="uint32_type" />
158 <xs:element name="description" type="xs:string" />
159 </xs:all>
160 </xs:complexType>
161
162 <xs:complexType name="event_list_type">
163 <xs:sequence>
164 <xs:element name="event" type="event_type" minOccurs="0" maxOccurs="unbounded" />
165 </xs:sequence>
166 </xs:complexType>
167
168 <!-- Maps to the lttng_domain_type enum -->
169 <xs:simpleType name="domain_type_type">
170 <xs:restriction base="xs:string">
171 <xs:enumeration value="KERNEL"/>
172 <xs:enumeration value="UST"/>
173 <xs:enumeration value="JUL"/>
174 </xs:restriction>
175 </xs:simpleType>
176
177 <!-- Maps to the lttng_buffer_type enum -->
178 <xs:simpleType name="domain_buffer_type">
179 <xs:restriction base="xs:string">
180 <xs:enumeration value="PER_PID"/>
181 <xs:enumeration value="PER_UID"/>
182 <xs:enumeration value="GLOBAL"/>
183 </xs:restriction>
184 </xs:simpleType>
185
186 <xs:simpleType name="channel_overwrite_mode_type">
187 <xs:restriction base="xs:string">
188 <xs:enumeration value="DISCARD" />
189 <xs:enumeration value="OVERWRITE" />
190 </xs:restriction>
191 </xs:simpleType>
192
193 <!-- Maps to the lttng_event_output enum -->
194 <xs:simpleType name="event_output_type">
195 <xs:restriction base="xs:string">
196 <xs:enumeration value="SPLICE" />
197 <xs:enumeration value="MMAP" />
198 </xs:restriction>
199 </xs:simpleType>
200
201 <xs:complexType name="pid_type">
202 <xs:all>
203 <xs:element name="id" type="xs:int"/>
204 <xs:element name="name" type="name_type"/>
205 <xs:element name="events" type="event_list_type" minOccurs="0" />
206 </xs:all>
207 </xs:complexType>
208
209 <xs:complexType name="pids_type">
210 <xs:sequence>
211 <xs:element name="pid" type="pid_type" minOccurs="0" maxOccurs="unbounded" />
212 </xs:sequence>
213 </xs:complexType>
214
215 <!-- Maps to struct lttng_domain and contains channels -->
216 <xs:complexType name="domain_type">
217 <xs:all>
218 <xs:element name="type" type="domain_type_type"/>
219 <xs:element name="buffer_type" type="domain_buffer_type"/>
220 <xs:element name="pids" type="pids_type" minOccurs="0" />
221 <xs:element name="channels" type="channels_type" minOccurs="0" />
222 <xs:element name="events" type="event_list_type" minOccurs="0" />
223 </xs:all>
224 </xs:complexType>
225
226 <!-- Maps to struct lttng_channel -->
227 <xs:complexType name="channel_type">
228 <xs:all>
229 <xs:element name="name" type="name_type"/>
230 <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0"/>
231 <xs:element name="attributes" type="channel_attributes_type" minOccurs="0"/>
232 <xs:element name="events" type="event_list_type"/>
233 </xs:all>
234 </xs:complexType>
235
236 <!-- Maps to struct lttng_channel_attr -->
237 <xs:complexType name="channel_attributes_type">
238 <xs:all>
239 <xs:element name="overwrite_mode" type="channel_overwrite_mode_type" default="DISCARD" minOccurs="0"/>
240 <xs:element name="subbuffer_size" type="uint64_type" minOccurs="0"/> <!-- bytes -->
241 <xs:element name="subbuffer_count" type="uint64_type" default="4" minOccurs="0"/>
242 <xs:element name="switch_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
243 <xs:element name="read_timer_interval" type="uint32_type"/> <!-- usec -->
244 <xs:element name="output_type" type="event_output_type"/>
245 <xs:element name="tracefile_size" type="uint64_type" default="0" minOccurs="0"/> <!-- bytes -->
246 <xs:element name="tracefile_count" type="uint64_type" default="0" minOccurs="0"/>
247 <xs:element name="live_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
248 </xs:all>
249 </xs:complexType>
250
251 <xs:complexType name="channels_type">
252 <xs:sequence>
253 <xs:element name="channel" type="channel_type" minOccurs="0" maxOccurs="unbounded" />
254 </xs:sequence>
255 </xs:complexType>
256
257 <xs:complexType name="session_type">
258 <xs:all>
259 <xs:element name="name" type="name_type" />
260 <xs:element name="path" type="name_type" />
261 <xs:element name="enabled" type="xs:boolean" default="false" />
262 <xs:element name="snapshot_mode" type="uint32_type" />
263 <xs:element name="live_timer_interval" type="uint32_type" />
264 <xs:element name="channels" type="channels_type" minOccurs="0" />
265 <xs:element name="domains" type="domains_type" minOccurs="0" />
266 </xs:all>
267 </xs:complexType>
268
269 <xs:complexType name="event_field_type">
270 <xs:all>
271 <xs:element name="name" type="name_type" />
272 <xs:element name="type" type="event_field_type_type"/>
273 <xs:element name="nowrite" type="xs:int"/>
274 </xs:all>
275 </xs:complexType>
276
277
278 <xs:complexType name="domains_type">
279 <xs:sequence>
280 <xs:element name="domain" type="domain_type" minOccurs="0" maxOccurs="unbounded" />
281 </xs:sequence>
282 </xs:complexType>
283
284 <xs:complexType name="sessions_type">
285 <xs:sequence>
286 <xs:element name="session" type="session_type" minOccurs="0" maxOccurs="unbounded" />
287 </xs:sequence>
288 </xs:complexType>
289
290 <xs:complexType name="event_fields_type">
291 <xs:sequence>
292 <xs:element name="event_field" type="event_field_type" minOccurs="0" maxOccurs="unbounded" />
293 </xs:sequence>
294 </xs:complexType>
295
296 <xs:complexType name="output_type">
297 <xs:choice>
298 <xs:element name="domains" type="domains_type" minOccurs="0" />
299 <xs:element name="sessions" type="sessions_type" minOccurs="0" />
300 <xs:element name="version" type="version_type" minOccurs="0" />
301 </xs:choice>
302 </xs:complexType>
303
304 <!-- Maps to the mi_lttng commands -->
305 <xs:simpleType name="command_string_type">
306 <xs:restriction base="xs:string">
307 <xs:enumeration value="list" />
308 <xs:enumeration value="version" />
309 </xs:restriction>
310 </xs:simpleType>
311
312 <xs:element name="command">
313 <xs:complexType>
314 <xs:all>
315 <xs:element name="name" type="command_string_type" maxOccurs="1" />
316 <xs:element name="output" type="output_type" maxOccurs="1" />
317 </xs:all>
318 </xs:complexType>
319 </xs:element>
320</xs:schema>
This page took 0.03377 seconds and 4 git commands to generate.