c5bd1d935a7b846f6b97a8b786789b9c7cd3cb06
[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 the lttng_loglevel_type enum -->
87 <xs:simpleType name="context_type_type">
88 <xs:restriction base="xs:string">
89 <xs:enumeration value="PERF_COUNTER" />
90 <xs:enumeration value="PERF_CPU_COUNTER" />
91 <xs:enumeration value="PERF_THREAD_COUNTER" />
92 <xs:enumeration value="PID" />
93 <xs:enumeration value="PROCNAME" />
94 <xs:enumeration value="PRIO" />
95 <xs:enumeration value="NICE" />
96 <xs:enumeration value="VPID" />
97 <xs:enumeration value="TID" />
98 <xs:enumeration value="VTID" />
99 <xs:enumeration value="PPID" />
100 <xs:enumeration value="VPPID" />
101 <xs:enumeration value="PTHREAD_ID" />
102 <xs:enumeration value="HOSTNAME" />
103 <xs:enumeration value="IP" />
104 </xs:restriction>
105 </xs:simpleType>
106
107 <!-- Maps to loglevel_string char * -->
108 <xs:simpleType name="loglevel_string_type">
109 <xs:restriction base="xs:string">
110 <xs:enumeration value="" />
111 <xs:enumeration value="TRACE_EMERG" />
112 <xs:enumeration value="TRACE_ALERT" />
113 <xs:enumeration value="TRACE_CRIT" />
114 <xs:enumeration value="TRACE_ERR" />
115 <xs:enumeration value="TRACE_WARNING" />
116 <xs:enumeration value="TRACE_NOTICE" />
117 <xs:enumeration value="TRACE_INFO" />
118 <xs:enumeration value="TRACE_DEBUG_SYSTEM" />
119 <xs:enumeration value="TRACE_DEBUG_PROGRAM" />
120 <xs:enumeration value="TRACE_DEBUG_PROCESS" />
121 <xs:enumeration value="TRACE_DEBUG_MODULE" />
122 <xs:enumeration value="TRACE_DEBUG_UNIT" />
123 <xs:enumeration value="TRACE_DEBUG_FUNCTION" />
124 <xs:enumeration value="TRACE_DEBUG_LINE" />
125 <xs:enumeration value="TRACE_DEBUG" />
126 <xs:enumeration value="JUL_OFF" />
127 <xs:enumeration value="JUL_SEVERE" />
128 <xs:enumeration value="JUL_WARNING" />
129 <xs:enumeration value="JUL_INFO" />
130 <xs:enumeration value="JUL_CONFIG" />
131 <xs:enumeration value="JUL_FINE" />
132 <xs:enumeration value="JUL_FINER" />
133 <xs:enumeration value="JUL_FINEST" />
134 <xs:enumeration value="JUL_ALL" />
135 <xs:enumeration value="UNKNOWN" />
136 </xs:restriction>
137 </xs:simpleType>
138
139 <!-- Maps to the lttng_calibrate_type enum -->
140 <xs:simpleType name="calibrate_type_type">
141 <xs:restriction base="xs:string">
142 <xs:enumeration value="FUNCTION" />
143 </xs:restriction>
144 </xs:simpleType>
145
146 <!-- Maps to the lttng_event_probe_attr struct -->
147 <xs:complexType name="event_probe_attributes_type">
148 <xs:all>
149 <xs:element name="address" type="uint64_type" />
150 <xs:element name="offset" type="uint64_type" />
151 <xs:element name="symbol_name" type="name_type" />
152 </xs:all>
153 </xs:complexType>
154
155 <!-- Maps to the lttng_event_function_attr struct -->
156 <xs:complexType name="event_ftrace_attributes_type">
157 <xs:all>
158 <xs:element name="symbol_name" type="name_type" />
159 </xs:all>
160 </xs:complexType>
161
162 <!-- Maps to per event type configuration -->
163 <xs:complexType name="event_attributes_type">
164 <xs:choice>
165 <xs:element name="probe_attributes" type="event_probe_attributes_type" />
166 <xs:element name="function_attributes" type="event_ftrace_attributes_type" />
167 </xs:choice>
168 </xs:complexType>
169
170 <!-- Maps to exclusion type -->
171 <xs:complexType name="event_exclusion_list_type">
172 <xs:sequence>
173 <xs:element name="exclusion" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
174 </xs:sequence>
175 </xs:complexType>
176
177 <!-- Maps to lttng_event struct -->
178 <xs:complexType name="event_type">
179 <xs:all>
180 <xs:element name="type" type="event_type_type" default="TRACEPOINT" minOccurs="0" />
181 <xs:element name="name" type="name_type" minOccurs="0" />
182 <xs:element name="loglevel_type" type="loglevel_type" default="ALL" minOccurs="0" />
183 <xs:element name="loglevel" type="loglevel_string_type" default="" minOccurs="0" />
184 <xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
185 <xs:element name="filter" type="xs:boolean" minOccurs="0" />
186 <xs:element name="exclusion" type="xs:boolean" minOccurs="0" />
187 <xs:element name="exclusions" type="event_exclusion_list_type" minOccurs="0"/>
188 <xs:element name="attributes" type="event_attributes_type" minOccurs="0" />
189 <xs:element name="event_fields" type="event_fields_type" minOccurs="0" />
190 <xs:element name="success" type="xs:boolean" minOccurs="0" />
191 </xs:all>
192 </xs:complexType>
193
194 <!-- Maps to mi_lttng_version struct -->
195 <xs:complexType name="version_type">
196 <xs:all>
197 <xs:element name="name" type="name_type" />
198 <xs:element name="string" type="name_type" />
199 <xs:element name="major" type="uint32_type" />
200 <xs:element name="url" type="xs:string" />
201 <xs:element name="minor" type="uint32_type" />
202 <xs:element name="commit" type="xs:string" />
203 <xs:element name="license" type="xs:string" />
204 <xs:element name="patchLevel" type="uint32_type" />
205 <xs:element name="description" type="xs:string" />
206 </xs:all>
207 </xs:complexType>
208
209 <!-- Maps to an array of event -->
210 <xs:complexType name="event_list_type">
211 <xs:sequence>
212 <xs:element name="event" type="event_type" minOccurs="0" maxOccurs="unbounded" />
213 </xs:sequence>
214 </xs:complexType>
215
216 <!-- Maps to the lttng_domain_type enum -->
217 <xs:simpleType name="domain_type_type">
218 <xs:restriction base="xs:string">
219 <xs:enumeration value="KERNEL"/>
220 <xs:enumeration value="UST"/>
221 <xs:enumeration value="JUL"/>
222 </xs:restriction>
223 </xs:simpleType>
224
225 <!-- Maps to the lttng_buffer_type enum -->
226 <xs:simpleType name="domain_buffer_type">
227 <xs:restriction base="xs:string">
228 <xs:enumeration value="PER_PID"/>
229 <xs:enumeration value="PER_UID"/>
230 <xs:enumeration value="GLOBAL"/>
231 </xs:restriction>
232 </xs:simpleType>
233
234 <!-- Maps to the type mode of a channel -->
235 <xs:simpleType name="channel_overwrite_mode_type">
236 <xs:restriction base="xs:string">
237 <xs:enumeration value="DISCARD" />
238 <xs:enumeration value="OVERWRITE" />
239 </xs:restriction>
240 </xs:simpleType>
241
242 <!-- Maps to the lttng_event_output enum -->
243 <xs:simpleType name="event_output_type">
244 <xs:restriction base="xs:string">
245 <xs:enumeration value="SPLICE" />
246 <xs:enumeration value="MMAP" />
247 </xs:restriction>
248 </xs:simpleType>
249
250 <!-- map to a pid -->
251 <xs:complexType name="pid_type">
252 <xs:all>
253 <xs:element name="id" type="xs:int" />
254 <xs:element name="name" type="name_type" />
255 <xs:element name="events" type="event_list_type" minOccurs="0" />
256 </xs:all>
257 </xs:complexType>
258
259 <!-- maps to an array of pid -->
260 <xs:complexType name="pids_type">
261 <xs:sequence>
262 <xs:element name="pid" type="pid_type" minOccurs="0" maxOccurs="unbounded" />
263 </xs:sequence>
264 </xs:complexType>
265
266 <!-- Maps to struct lttng_domain and contains channels -->
267 <xs:complexType name="domain_type">
268 <xs:all>
269 <xs:element name="type" type="domain_type_type" />
270 <xs:element name="buffer_type" type="domain_buffer_type" />
271 <xs:element name="pids" type="pids_type" minOccurs="0" />
272 <xs:element name="channels" type="channels_type" minOccurs="0" />
273 <xs:element name="events" type="event_list_type" minOccurs="0" />
274 </xs:all>
275 </xs:complexType>
276
277 <!-- Maps to struct lttng_channel -->
278 <xs:complexType name="channel_type">
279 <xs:all>
280 <xs:element name="name" type="name_type" />
281 <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0" />
282 <xs:element name="attributes" type="channel_attributes_type" minOccurs="0" />
283 <xs:element name="events" type="event_list_type" minOccurs="0" />
284 </xs:all>
285 </xs:complexType>
286
287 <!-- Maps to struct lttng_channel_attr -->
288 <xs:complexType name="channel_attributes_type">
289 <xs:all>
290 <xs:element name="overwrite_mode" type="channel_overwrite_mode_type" default="DISCARD" minOccurs="0" />
291 <xs:element name="subbuffer_size" type="uint64_type" minOccurs="0" /> <!-- bytes -->
292 <xs:element name="subbuffer_count" type="uint64_type" default="4" minOccurs="0" />
293 <xs:element name="switch_timer_interval" type="uint32_type" default="0" minOccurs="0" /> <!-- usec -->
294 <xs:element name="read_timer_interval" type="uint32_type" /> <!-- usec -->
295 <xs:element name="output_type" type="event_output_type" />
296 <xs:element name="tracefile_size" type="uint64_type" default="0" minOccurs="0" /> <!-- bytes -->
297 <xs:element name="tracefile_count" type="uint64_type" default="0" minOccurs="0" />
298 <xs:element name="live_timer_interval" type="uint32_type" default="0" minOccurs="0" /> <!-- usec -->
299 </xs:all>
300 </xs:complexType>
301
302 <!-- Maps to struct lttng_snapshot_output -->
303 <xs:complexType name="snapshot_type">
304 <xs:all>
305 <xs:element name="id" type="uint32_type" minOccurs="0" />
306 <xs:element name="max_size" type="uint64_type" minOccurs="0" />
307 <xs:element name="name" type="name_type" minOccurs="0" />
308 <xs:element name="session_name" type="name_type" minOccurs="0" />
309 <xs:element name="ctrl_url" type="name_type" minOccurs="0" />
310 <xs:element name="data_url" type="name_type" minOccurs="0" />
311 </xs:all>
312 </xs:complexType>
313
314 <xs:complexType name="snapshots_type">
315 <xs:sequence>
316 <xs:element name="snapshot" type="snapshot_type" minOccurs="0" maxOccurs="unbounded" />
317 </xs:sequence>
318 </xs:complexType>
319
320 <xs:complexType name="channels_type">
321 <xs:sequence>
322 <xs:element name="channel" type="channel_type" minOccurs="0" maxOccurs="unbounded" />
323 </xs:sequence>
324 </xs:complexType>
325
326 <!-- Maps to a lttng_session -->
327 <xs:complexType name="session_type">
328 <xs:all>
329 <xs:element name="name" type="name_type" />
330 <xs:element name="path" type="name_type" minOccurs="0" />
331 <xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
332 <xs:element name="snapshot_mode" type="uint32_type" minOccurs="0" />
333 <xs:element name="live_timer_interval" type="uint32_type" minOccurs="0" />
334 <xs:element name="channels" type="channels_type" minOccurs="0" />
335 <xs:element name="domains" type="domains_type" minOccurs="0" />
336 <xs:element name="snapshots" type="snapshots_type" minOccurs="0" />
337 </xs:all>
338 </xs:complexType>
339
340 <!-- Maps to a lttng_event_field -->
341 <xs:complexType name="event_field_type">
342 <xs:all>
343 <xs:element name="name" type="name_type" />
344 <xs:element name="type" type="event_field_type_type" />
345 <xs:element name="nowrite" type="xs:int" />
346 </xs:all>
347 </xs:complexType>
348
349 <!-- Map to the save command -->
350 <xs:complexType name="save_type">
351 <xs:all>
352 <xs:element name="session" type="session_type" />
353 <xs:element name="path" type="name_type" />
354 </xs:all>
355 </xs:complexType>
356
357 <!-- Map to the load command -->
358 <xs:complexType name="load_type">
359 <xs:all>
360 <xs:element name="session" type="session_type" />
361 <xs:element name="path" type="name_type" />
362 </xs:all>
363 </xs:complexType>
364
365 <!-- Maps to struct lttng_calibrate -->
366 <xs:complexType name="calibrate_type">
367 <xs:all>
368 <xs:element name="type" type="calibrate_type_type" />
369 </xs:all>
370 </xs:complexType>
371
372 <!-- Map to lttng_event_perf_counter_ctx -->
373 <xs:complexType name="perf_counter_context_type">
374 <xs:all>
375 <xs:element name="type" type="uint32_type" />
376 <xs:element name="config" type="uint64_type" />
377 <xs:element name="name" type="name_type" />
378 </xs:all>
379 </xs:complexType>
380
381 <!-- Map to lttng_event_context -->
382 <xs:complexType name="context_type">
383 <xs:all>
384 <xs:element name="type" type="context_type_type" />
385 <xs:element name="perf_counter_context" type="perf_counter_context_type" minOccurs="0" />
386 <xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
387 </xs:all>
388 </xs:complexType>
389
390 <!-- Maps to an array of domain -->
391 <xs:complexType name="domains_type">
392 <xs:sequence>
393 <xs:element name="domain" type="domain_type" minOccurs="0" maxOccurs="unbounded" />
394 </xs:sequence>
395 </xs:complexType>
396
397 <!-- Maps to an array of session -->
398 <xs:complexType name="sessions_type">
399 <xs:sequence>
400 <xs:element name="session" type="session_type" minOccurs="0" maxOccurs="unbounded" />
401 </xs:sequence>
402 </xs:complexType>
403
404 <!-- Maps to an array of event_field -->
405 <xs:complexType name="event_fields_type">
406 <xs:sequence>
407 <xs:element name="event_field" type="event_field_type" minOccurs="0" maxOccurs="unbounded" />
408 </xs:sequence>
409 </xs:complexType>
410
411 <!-- Maps to an array of context -->
412 <xs:complexType name="contexts_type">
413 <xs:sequence>
414 <xs:element name="context" type="context_type" minOccurs="0" maxOccurs="unbounded" />
415 </xs:sequence>
416 </xs:complexType>
417
418 <!-- Maps to an action dutring snapshot command -->
419 <xs:complexType name="snapshot_action_type">
420 <xs:sequence>
421 <xs:element name="name" type="snapshot_actiontype_type" minOccurs="0" />
422 <xs:element name="output" type="output_type" minOccurs="0" />
423 </xs:sequence>
424 </xs:complexType>
425
426 <!-- Type of snapshot commands -->
427 <xs:simpleType name="snapshot_actiontype_type">
428 <xs:restriction base="xs:string">
429 <xs:enumeration value="list-output" />
430 <xs:enumeration value="del-output" />
431 <xs:enumeration value="add-output" />
432 <xs:enumeration value="record-output" />
433 </xs:restriction>
434 </xs:simpleType>
435
436 <xs:complexType name="output_type">
437 <xs:choice>
438 <xs:element name="domains" type="domains_type" minOccurs="0" />
439 <xs:element name="session" type="session_type" minOccurs="0" />
440 <xs:element name="sessions" type="sessions_type" minOccurs="0" />
441 <xs:element name="session" type="session_type" minOccurs="0" />
442 <xs:element name="snapshot_action" type="snapshot_action_type" minOccurs="0" />
443 <xs:element name="version" type="version_type" minOccurs="0" />
444 <xs:element name="save" type="save_type" minOccurs="0" />
445 <xs:element name="load" type="load_type" minOccurs="0" />
446 <xs:element name="calibrate" type="calibrate_type" minOccurs="0" />
447 <xs:element name="contexts" type="contexts_type" minOccurs="0" />
448 <xs:element name="channels" type="channels_type" minOccurs="0" />
449 <xs:element name="events" type="event_list_type" minOccurs="0" />
450 <xs:element name="channel" type="channel_type" minOccurs="0" />
451 <xs:element name="channels" type="channels_type" minOccurs="0" />
452 </xs:choice>
453 </xs:complexType>
454
455 <!-- Maps to the mi_lttng commands -->
456 <xs:simpleType name="command_string_type">
457 <xs:restriction base="xs:string">
458 <xs:enumeration value="create" />
459 <xs:enumeration value="list" />
460 <xs:enumeration value="snapshot" />
461 <xs:enumeration value="version" />
462 <xs:enumeration value="save" />
463 <xs:enumeration value="load" />
464 <xs:enumeration value="start" />
465 <xs:enumeration value="stop" />
466 <xs:enumeration value="destroy" />
467 <xs:enumeration value="calibrate" />
468 <xs:enumeration value="add-context" />
469 <xs:enumeration value="enable-channel" />
470 <xs:enumeration value="enable-event" />
471 <xs:enumeration value="set-session" />
472 <xs:enumeration value="disable-event" />
473 <xs:enumeration value="disable-channel" />
474 </xs:restriction>
475 </xs:simpleType>
476
477 <xs:element name="command">
478 <xs:complexType>
479 <xs:all>
480 <xs:element name="name" type="command_string_type" maxOccurs="1" />
481 <xs:element name="output" type="output_type" maxOccurs="1" />
482 <xs:element name="success" type="xs:boolean" minOccurs="0" maxOccurs="1" />
483 </xs:all>
484 </xs:complexType>
485 </xs:element>
486 </xs:schema>
This page took 0.05811 seconds and 3 git commands to generate.