884830d1c32c65de867de363501a283def9a7b64
[lttng-tools.git] / src / common / mi_lttng.xsd
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 Copyright (c) 2014 - Oliver Cotte <olivier.cotte@polymtl.ca>
4 - Jonathan Rajotte <jonathan.r.julien@gmail.com>
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 THE 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_calibrate_type enum -->
110 <xs:simpleType name="calibrate_type_type">
111 <xs:restriction base="xs:string">
112 <xs:enumeration value="FUNCTION" />
113 </xs:restriction>
114 </xs:simpleType>
115
116 <!-- Maps to the lttng_event_probe_attr struct -->
117 <xs:complexType name="event_probe_attributes_type">
118 <xs:all>
119 <xs:element name="address" type="uint64_type" />
120 <xs:element name="offset" type="uint64_type" />
121 <xs:element name="symbol_name" type="name_type" />
122 </xs:all>
123 </xs:complexType>
124
125 <!-- Maps to the lttng_event_function_attr struct -->
126 <xs:complexType name="event_ftrace_attributes_type">
127 <xs:all>
128 <xs:element name="symbol_name" type="name_type" />
129 </xs:all>
130 </xs:complexType>
131
132 <!-- Maps to per event type configuration -->
133 <xs:complexType name="event_attributes_type">
134 <xs:choice>
135 <xs:element name="probe_attributes" type="event_probe_attributes_type" />
136 <xs:element name="function_attributes" type="event_ftrace_attributes_type" />
137 </xs:choice>
138 </xs:complexType>
139
140 <!-- Maps to lttng_event struct -->
141 <xs:complexType name="event_type">
142 <xs:all>
143 <xs:element name="type" type="event_type_type" default="TRACEPOINT" minOccurs="0" />
144 <xs:element name="name" type="name_type" minOccurs="0" />
145 <xs:element name="loglevel_type" type="loglevel_type" default="ALL" minOccurs="0" />
146 <xs:element name="loglevel" type="loglevel_string_type" default="" minOccurs="0" />
147 <xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
148 <xs:element name="filter" type="xs:boolean" minOccurs="0" />
149 <xs:element name="exclusion" type="xs:boolean" minOccurs="0" />
150 <xs:element name="attributes" type="event_attributes_type" minOccurs="0" />
151 <xs:element name="event_fields" type="event_fields_type" minOccurs="0" />
152 </xs:all>
153 </xs:complexType>
154
155 <!-- Maps to mi_lttng_version struct -->
156 <xs:complexType name="version_type">
157 <xs:all>
158 <xs:element name="name" type="name_type" />
159 <xs:element name="string" type="name_type" />
160 <xs:element name="major" type="uint32_type" />
161 <xs:element name="url" type="xs:string" />
162 <xs:element name="minor" type="uint32_type" />
163 <xs:element name="commit" type="xs:string" />
164 <xs:element name="license" type="xs:string" />
165 <xs:element name="patchLevel" type="uint32_type" />
166 <xs:element name="description" type="xs:string" />
167 </xs:all>
168 </xs:complexType>
169
170 <xs:complexType name="event_list_type">
171 <xs:sequence>
172 <xs:element name="event" type="event_type" minOccurs="0" maxOccurs="unbounded" />
173 </xs:sequence>
174 </xs:complexType>
175
176 <!-- Maps to the lttng_domain_type enum -->
177 <xs:simpleType name="domain_type_type">
178 <xs:restriction base="xs:string">
179 <xs:enumeration value="KERNEL"/>
180 <xs:enumeration value="UST"/>
181 <xs:enumeration value="JUL"/>
182 </xs:restriction>
183 </xs:simpleType>
184
185 <!-- Maps to the lttng_buffer_type enum -->
186 <xs:simpleType name="domain_buffer_type">
187 <xs:restriction base="xs:string">
188 <xs:enumeration value="PER_PID"/>
189 <xs:enumeration value="PER_UID"/>
190 <xs:enumeration value="GLOBAL"/>
191 </xs:restriction>
192 </xs:simpleType>
193
194 <xs:simpleType name="channel_overwrite_mode_type">
195 <xs:restriction base="xs:string">
196 <xs:enumeration value="DISCARD" />
197 <xs:enumeration value="OVERWRITE" />
198 </xs:restriction>
199 </xs:simpleType>
200
201 <!-- Maps to the lttng_event_output enum -->
202 <xs:simpleType name="event_output_type">
203 <xs:restriction base="xs:string">
204 <xs:enumeration value="SPLICE" />
205 <xs:enumeration value="MMAP" />
206 </xs:restriction>
207 </xs:simpleType>
208
209 <xs:complexType name="pid_type">
210 <xs:all>
211 <xs:element name="id" type="xs:int"/>
212 <xs:element name="name" type="name_type"/>
213 <xs:element name="events" type="event_list_type" minOccurs="0" />
214 </xs:all>
215 </xs:complexType>
216
217 <xs:complexType name="pids_type">
218 <xs:sequence>
219 <xs:element name="pid" type="pid_type" minOccurs="0" maxOccurs="unbounded" />
220 </xs:sequence>
221 </xs:complexType>
222
223 <!-- Maps to struct lttng_domain and contains channels -->
224 <xs:complexType name="domain_type">
225 <xs:all>
226 <xs:element name="type" type="domain_type_type"/>
227 <xs:element name="buffer_type" type="domain_buffer_type" />
228 <xs:element name="pids" type="pids_type" minOccurs="0" />
229 <xs:element name="channels" type="channels_type" minOccurs="0" />
230 <xs:element name="events" type="event_list_type" minOccurs="0" />
231 </xs:all>
232 </xs:complexType>
233
234 <!-- Maps to struct lttng_channel -->
235 <xs:complexType name="channel_type">
236 <xs:all>
237 <xs:element name="name" type="name_type"/>
238 <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0"/>
239 <xs:element name="attributes" type="channel_attributes_type" minOccurs="0"/>
240 <xs:element name="events" type="event_list_type"/>
241 </xs:all>
242 </xs:complexType>
243
244 <!-- Maps to struct lttng_channel_attr -->
245 <xs:complexType name="channel_attributes_type">
246 <xs:all>
247 <xs:element name="overwrite_mode" type="channel_overwrite_mode_type" default="DISCARD" minOccurs="0"/>
248 <xs:element name="subbuffer_size" type="uint64_type" minOccurs="0"/> <!-- bytes -->
249 <xs:element name="subbuffer_count" type="uint64_type" default="4" minOccurs="0"/>
250 <xs:element name="switch_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
251 <xs:element name="read_timer_interval" type="uint32_type"/> <!-- usec -->
252 <xs:element name="output_type" type="event_output_type"/>
253 <xs:element name="tracefile_size" type="uint64_type" default="0" minOccurs="0"/> <!-- bytes -->
254 <xs:element name="tracefile_count" type="uint64_type" default="0" minOccurs="0"/>
255 <xs:element name="live_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
256 </xs:all>
257 </xs:complexType>
258
259 <xs:complexType name="channels_type">
260 <xs:sequence>
261 <xs:element name="channel" type="channel_type" minOccurs="0" maxOccurs="unbounded" />
262 </xs:sequence>
263 </xs:complexType>
264
265 <xs:complexType name="session_type">
266 <xs:all>
267 <xs:element name="name" type="name_type" />
268 <xs:element name="path" type="name_type" minOccurs="0" />
269 <xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
270 <xs:element name="snapshot_mode" type="uint32_type" minOccurs="0" />
271 <xs:element name="live_timer_interval" type="uint32_type" minOccurs="0" />
272 <xs:element name="channels" type="channels_type" minOccurs="0" />
273 <xs:element name="domains" type="domains_type" minOccurs="0" />
274 </xs:all>
275 </xs:complexType>
276
277 <xs:complexType name="event_field_type">
278 <xs:all>
279 <xs:element name="name" type="name_type" />
280 <xs:element name="type" type="event_field_type_type"/>
281 <xs:element name="nowrite" type="xs:int"/>
282 </xs:all>
283 </xs:complexType>
284
285 <!-- map to the save command -->
286 <xs:complexType name="save_type">
287 <xs:all>
288 <xs:element name="session" type="session_type" />
289 <xs:element name="path" type="name_type"/>
290 </xs:all>
291 </xs:complexType>
292
293 <!-- map to the load command -->
294 <xs:complexType name="load_type">
295 <xs:all>
296 <xs:element name="session" type="session_type" />
297 <xs:element name="path" type="name_type"/>
298 </xs:all>
299 </xs:complexType>
300
301 <!-- Maps to struct lttng_calibrate -->
302 <xs:complexType name="calibrate_type">
303 <xs:all>
304 <xs:element name="type" type="calibrate_type_type" />
305 </xs:all>
306 </xs:complexType>
307
308 <xs:complexType name="domains_type">
309 <xs:sequence>
310 <xs:element name="domain" type="domain_type" minOccurs="0" maxOccurs="unbounded" />
311 </xs:sequence>
312 </xs:complexType>
313
314 <xs:complexType name="sessions_type">
315 <xs:sequence>
316 <xs:element name="session" type="session_type" minOccurs="0" maxOccurs="unbounded" />
317 </xs:sequence>
318 </xs:complexType>
319
320 <xs:complexType name="event_fields_type">
321 <xs:sequence>
322 <xs:element name="event_field" type="event_field_type" minOccurs="0" maxOccurs="unbounded" />
323 </xs:sequence>
324 </xs:complexType>
325
326 <xs:complexType name="output_type">
327 <xs:choice>
328 <xs:element name="domains" type="domains_type" minOccurs="0" />
329 <xs:element name="sessions" type="sessions_type" minOccurs="0" />
330 <xs:element name="session" type="session_type" minOccurs="0" />
331 <xs:element name="version" type="version_type" minOccurs="0" />
332 <xs:element name="save" type="save_type" minOccurs="0" />
333 <xs:element name="load" type="load_type" minOccurs="0" />
334 <xs:element name="calibrate" type="calibrate_type" minOccurs="0" />
335 </xs:choice>
336 </xs:complexType>
337
338 <!-- Maps to the mi_lttng commands -->
339 <xs:simpleType name="command_string_type">
340 <xs:restriction base="xs:string">
341 <xs:enumeration value="create" />
342 <xs:enumeration value="list" />
343 <xs:enumeration value="version" />
344 <xs:enumeration value="save" />
345 <xs:enumeration value="load" />
346 <xs:enumeration value="start" />
347 <xs:enumeration value="stop" />
348 <xs:enumeration value="destroy" />
349 <xs:enumeration value="calibrate" />
350 </xs:restriction>
351 </xs:simpleType>
352
353 <xs:element name="command">
354 <xs:complexType>
355 <xs:all>
356 <xs:element name="name" type="command_string_type" maxOccurs="1" />
357 <xs:element name="output" type="output_type" maxOccurs="1" />
358 <xs:element name="success" type="xs:boolean" minOccurs="0" maxOccurs="1" />
359 </xs:all>
360 </xs:complexType>
361 </xs:element>
362 </xs:schema>
This page took 0.035355 seconds and 3 git commands to generate.