Mi set-session command: support and validation
[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="UNKNOWN" />
127 </xs:restriction>
128 </xs:simpleType>
129
130 <!-- Maps to the lttng_calibrate_type enum -->
131 <xs:simpleType name="calibrate_type_type">
132 <xs:restriction base="xs:string">
133 <xs:enumeration value="FUNCTION" />
134 </xs:restriction>
135 </xs:simpleType>
136
137 <!-- Maps to the lttng_event_probe_attr struct -->
138 <xs:complexType name="event_probe_attributes_type">
139 <xs:all>
140 <xs:element name="address" type="uint64_type" />
141 <xs:element name="offset" type="uint64_type" />
142 <xs:element name="symbol_name" type="name_type" />
143 </xs:all>
144 </xs:complexType>
145
146 <!-- Maps to the lttng_event_function_attr struct -->
147 <xs:complexType name="event_ftrace_attributes_type">
148 <xs:all>
149 <xs:element name="symbol_name" type="name_type" />
150 </xs:all>
151 </xs:complexType>
152
153 <!-- Maps to per event type configuration -->
154 <xs:complexType name="event_attributes_type">
155 <xs:choice>
156 <xs:element name="probe_attributes" type="event_probe_attributes_type" />
157 <xs:element name="function_attributes" type="event_ftrace_attributes_type" />
158 </xs:choice>
159 </xs:complexType>
160
161 <xs:complexType name="event_exclusion_list_type">
162 <xs:sequence>
163 <xs:element name="exclusion" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
164 </xs:sequence>
165 </xs:complexType>
166
167 <!-- Maps to lttng_event struct -->
168 <xs:complexType name="event_type">
169 <xs:all>
170 <xs:element name="type" type="event_type_type" default="TRACEPOINT" minOccurs="0" />
171 <xs:element name="name" type="name_type" minOccurs="0" />
172 <xs:element name="loglevel_type" type="loglevel_type" default="ALL" minOccurs="0" />
173 <xs:element name="loglevel" type="loglevel_string_type" default="" minOccurs="0" />
174 <xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
175 <xs:element name="filter" type="xs:boolean" minOccurs="0" />
176 <xs:element name="exclusion" type="xs:boolean" minOccurs="0" />
177 <xs:element name="exclusions" type="event_exclusion_list_type" minOccurs="0"/>
178 <xs:element name="attributes" type="event_attributes_type" minOccurs="0" />
179 <xs:element name="event_fields" type="event_fields_type" minOccurs="0" />
180 <xs:element name="success" type="xs:boolean" minOccurs="0" />
181 </xs:all>
182 </xs:complexType>
183
184 <!-- Maps to mi_lttng_version struct -->
185 <xs:complexType name="version_type">
186 <xs:all>
187 <xs:element name="name" type="name_type" />
188 <xs:element name="string" type="name_type" />
189 <xs:element name="major" type="uint32_type" />
190 <xs:element name="url" type="xs:string" />
191 <xs:element name="minor" type="uint32_type" />
192 <xs:element name="commit" type="xs:string" />
193 <xs:element name="license" type="xs:string" />
194 <xs:element name="patchLevel" type="uint32_type" />
195 <xs:element name="description" type="xs:string" />
196 </xs:all>
197 </xs:complexType>
198
199 <xs:complexType name="event_list_type">
200 <xs:sequence>
201 <xs:element name="event" type="event_type" minOccurs="0" maxOccurs="unbounded" />
202 </xs:sequence>
203 </xs:complexType>
204
205 <!-- Maps to the lttng_domain_type enum -->
206 <xs:simpleType name="domain_type_type">
207 <xs:restriction base="xs:string">
208 <xs:enumeration value="KERNEL"/>
209 <xs:enumeration value="UST"/>
210 <xs:enumeration value="JUL"/>
211 </xs:restriction>
212 </xs:simpleType>
213
214 <!-- Maps to the lttng_buffer_type enum -->
215 <xs:simpleType name="domain_buffer_type">
216 <xs:restriction base="xs:string">
217 <xs:enumeration value="PER_PID"/>
218 <xs:enumeration value="PER_UID"/>
219 <xs:enumeration value="GLOBAL"/>
220 </xs:restriction>
221 </xs:simpleType>
222
223 <xs:simpleType name="channel_overwrite_mode_type">
224 <xs:restriction base="xs:string">
225 <xs:enumeration value="DISCARD" />
226 <xs:enumeration value="OVERWRITE" />
227 </xs:restriction>
228 </xs:simpleType>
229
230 <!-- Maps to the lttng_event_output enum -->
231 <xs:simpleType name="event_output_type">
232 <xs:restriction base="xs:string">
233 <xs:enumeration value="SPLICE" />
234 <xs:enumeration value="MMAP" />
235 </xs:restriction>
236 </xs:simpleType>
237
238 <xs:complexType name="pid_type">
239 <xs:all>
240 <xs:element name="id" type="xs:int"/>
241 <xs:element name="name" type="name_type"/>
242 <xs:element name="events" type="event_list_type" minOccurs="0" />
243 </xs:all>
244 </xs:complexType>
245
246 <xs:complexType name="pids_type">
247 <xs:sequence>
248 <xs:element name="pid" type="pid_type" minOccurs="0" maxOccurs="unbounded" />
249 </xs:sequence>
250 </xs:complexType>
251
252 <!-- Maps to struct lttng_domain and contains channels -->
253 <xs:complexType name="domain_type">
254 <xs:all>
255 <xs:element name="type" type="domain_type_type"/>
256 <xs:element name="buffer_type" type="domain_buffer_type" />
257 <xs:element name="pids" type="pids_type" minOccurs="0" />
258 <xs:element name="channels" type="channels_type" minOccurs="0" />
259 <xs:element name="events" type="event_list_type" minOccurs="0" />
260 </xs:all>
261 </xs:complexType>
262
263 <!-- Maps to struct lttng_channel -->
264 <xs:complexType name="channel_type">
265 <xs:all>
266 <xs:element name="name" type="name_type"/>
267 <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0"/>
268 <xs:element name="attributes" type="channel_attributes_type" minOccurs="0"/>
269 <xs:element name="events" type="event_list_type" minOccurs="0" />
270 </xs:all>
271 </xs:complexType>
272
273 <!-- Maps to struct lttng_channel_attr -->
274 <xs:complexType name="channel_attributes_type">
275 <xs:all>
276 <xs:element name="overwrite_mode" type="channel_overwrite_mode_type" default="DISCARD" minOccurs="0"/>
277 <xs:element name="subbuffer_size" type="uint64_type" minOccurs="0"/> <!-- bytes -->
278 <xs:element name="subbuffer_count" type="uint64_type" default="4" minOccurs="0"/>
279 <xs:element name="switch_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
280 <xs:element name="read_timer_interval" type="uint32_type"/> <!-- usec -->
281 <xs:element name="output_type" type="event_output_type"/>
282 <xs:element name="tracefile_size" type="uint64_type" default="0" minOccurs="0"/> <!-- bytes -->
283 <xs:element name="tracefile_count" type="uint64_type" default="0" minOccurs="0"/>
284 <xs:element name="live_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
285 </xs:all>
286 </xs:complexType>
287
288 <xs:complexType name="channels_type">
289 <xs:sequence>
290 <xs:element name="channel" type="channel_type" minOccurs="0" maxOccurs="unbounded" />
291 </xs:sequence>
292 </xs:complexType>
293
294 <xs:complexType name="session_type">
295 <xs:all>
296 <xs:element name="name" type="name_type" />
297 <xs:element name="path" type="name_type" minOccurs="0" />
298 <xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
299 <xs:element name="snapshot_mode" type="uint32_type" minOccurs="0" />
300 <xs:element name="live_timer_interval" type="uint32_type" minOccurs="0" />
301 <xs:element name="channels" type="channels_type" minOccurs="0" />
302 <xs:element name="domains" type="domains_type" minOccurs="0" />
303 </xs:all>
304 </xs:complexType>
305
306 <xs:complexType name="event_field_type">
307 <xs:all>
308 <xs:element name="name" type="name_type" />
309 <xs:element name="type" type="event_field_type_type"/>
310 <xs:element name="nowrite" type="xs:int"/>
311 </xs:all>
312 </xs:complexType>
313
314 <!-- map to the save command -->
315 <xs:complexType name="save_type">
316 <xs:all>
317 <xs:element name="session" type="session_type" />
318 <xs:element name="path" type="name_type"/>
319 </xs:all>
320 </xs:complexType>
321
322 <!-- map to the load command -->
323 <xs:complexType name="load_type">
324 <xs:all>
325 <xs:element name="session" type="session_type" />
326 <xs:element name="path" type="name_type"/>
327 </xs:all>
328 </xs:complexType>
329
330 <!-- Maps to struct lttng_calibrate -->
331 <xs:complexType name="calibrate_type">
332 <xs:all>
333 <xs:element name="type" type="calibrate_type_type" />
334 </xs:all>
335 </xs:complexType>
336
337 <!-- Map to lttng_event_perf_counter_ctx -->
338 <xs:complexType name="perf_counter_context_type">
339 <xs:all>
340 <xs:element name="type" type="uint32_type" />
341 <xs:element name="config" type="uint64_type" />
342 <xs:element name="name" type="name_type" />
343 </xs:all>
344 </xs:complexType>
345
346 <!-- Map to lttng_event_context -->
347 <xs:complexType name="context_type">
348 <xs:all>
349 <xs:element name="type" type="context_type_type" />
350 <xs:element name="perf_counter_context" type="perf_counter_context_type" minOccurs="0" />
351 <!-- The success element is present only for lttng cli command add-context -->
352 <xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
353 </xs:all>
354 </xs:complexType>
355
356 <xs:complexType name="domains_type">
357 <xs:sequence>
358 <xs:element name="domain" type="domain_type" minOccurs="0" maxOccurs="unbounded" />
359 </xs:sequence>
360 </xs:complexType>
361
362 <xs:complexType name="sessions_type">
363 <xs:sequence>
364 <xs:element name="session" type="session_type" minOccurs="0" maxOccurs="unbounded" />
365 </xs:sequence>
366 </xs:complexType>
367
368 <xs:complexType name="event_fields_type">
369 <xs:sequence>
370 <xs:element name="event_field" type="event_field_type" minOccurs="0" maxOccurs="unbounded" />
371 </xs:sequence>
372 </xs:complexType>
373
374 <xs:complexType name="contexts_type">
375 <xs:sequence>
376 <xs:element name="context" type="context_type" minOccurs="0" maxOccurs="unbounded" />
377 </xs:sequence>
378 </xs:complexType>
379
380 <xs:complexType name="output_type">
381 <xs:choice>
382 <xs:element name="domains" type="domains_type" minOccurs="0" />
383 <xs:element name="sessions" type="sessions_type" minOccurs="0" />
384 <xs:element name="session" type="session_type" minOccurs="0" />
385 <xs:element name="version" type="version_type" minOccurs="0" />
386 <xs:element name="save" type="save_type" minOccurs="0" />
387 <xs:element name="load" type="load_type" minOccurs="0" />
388 <xs:element name="calibrate" type="calibrate_type" minOccurs="0" />
389 <xs:element name="contexts" type="contexts_type" minOccurs="0" />
390 <xs:element name="channels" type="channels_type" minOccurs="0" />
391 <xs:element name="events" type="event_list_type" minOccurs="0" />
392 </xs:choice>
393 </xs:complexType>
394
395 <!-- Maps to the mi_lttng commands -->
396 <xs:simpleType name="command_string_type">
397 <xs:restriction base="xs:string">
398 <xs:enumeration value="create" />
399 <xs:enumeration value="list" />
400 <xs:enumeration value="version" />
401 <xs:enumeration value="save" />
402 <xs:enumeration value="load" />
403 <xs:enumeration value="start" />
404 <xs:enumeration value="stop" />
405 <xs:enumeration value="destroy" />
406 <xs:enumeration value="calibrate" />
407 <xs:enumeration value="add-context" />
408 <xs:enumeration value="enable-channel" />
409 <xs:enumeration value="enable-event" />
410 <xs:enumeration value="set-session" />
411 </xs:restriction>
412 </xs:simpleType>
413
414 <xs:element name="command">
415 <xs:complexType>
416 <xs:all>
417 <xs:element name="name" type="command_string_type" maxOccurs="1" />
418 <xs:element name="output" type="output_type" maxOccurs="1" />
419 <xs:element name="success" type="xs:boolean" minOccurs="0" maxOccurs="1" />
420 </xs:all>
421 </xs:complexType>
422 </xs:element>
423 </xs:schema>
This page took 0.057555 seconds and 4 git commands to generate.