<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2014 EfficiOS Inc.
Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>

SPDX-License-Identifier: MIT

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	targetNamespace="https://lttng.org/xml/ns/lttng-mi"
	xmlns:tns="https://lttng.org/xml/ns/lttng-mi"
	elementFormDefault="qualified" version="4.1">

	<!-- Maps to the uint32_t type -->
	<xs:simpleType name="uint32_type">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0" />
			<xs:maxInclusive value="4294967295" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the uint64_t type -->
	<xs:simpleType name="uint64_type">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0" />
			<xs:maxInclusive value="18446744073709551615" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the uint64_t type -->
	<xs:simpleType name="ratio_type">
		<xs:restriction base="xs:double">
			<xs:minInclusive value="0" />
			<xs:maxInclusive value="1" />
		</xs:restriction>
	</xs:simpleType>

	<!--
	Maps to the range allowed for blocking timeout: -1 (block
	forever), 0 (do not block), positive integer value (blocking
	time in usec) limited by its signed 32-bit representation when
	converted to msec.
	-->
	<xs:simpleType name="blocking_timeout_type">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="-1" />
			<xs:maxInclusive value="2147483648000" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the char name[LTTNG_SYMBOL_NAME_LEN] -->
	<xs:simpleType name="name_type">
		<xs:restriction base="xs:string">
			<xs:maxLength value="255" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_event_type enum -->
	<xs:simpleType name="event_type_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="ALL" />
			<xs:enumeration value="TRACEPOINT" />
			<xs:enumeration value="PROBE" />
			<xs:enumeration value="FUNCTION" />
			<xs:enumeration value="FUNCTION_ENTRY" />
			<xs:enumeration value="NOOP" />
			<xs:enumeration value="SYSCALL" />
			<xs:enumeration value="USERSPACE_PROBE" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_event_field_type enum -->
	<xs:simpleType name="event_field_type_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="OTHER" />
			<xs:enumeration value="INTEGER" />
			<xs:enumeration value="ENUM" />
			<xs:enumeration value="FLOAT" />
			<xs:enumeration value="STRING" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_loglevel_type enum -->
	<xs:simpleType name="loglevel_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="ALL" />
			<xs:enumeration value="RANGE" />
			<xs:enumeration value="SINGLE" />
			<xs:enumeration value="UNKNOWN" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_event_context_type enum -->
	<xs:simpleType name="context_type_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="PID" />
			<xs:enumeration value="PROCNAME" />
			<xs:enumeration value="PRIO" />
			<xs:enumeration value="NICE" />
			<xs:enumeration value="VPID" />
			<xs:enumeration value="TID" />
			<xs:enumeration value="VTID" />
			<xs:enumeration value="PPID" />
			<xs:enumeration value="VPPID" />
			<xs:enumeration value="PTHREAD_ID" />
			<xs:enumeration value="HOSTNAME" />
			<xs:enumeration value="IP" />
			<xs:enumeration value="INTERRUPTIBLE" />
			<xs:enumeration value="PREEMPTIBLE" />
			<xs:enumeration value="NEED_RESCHEDULE" />
			<xs:enumeration value="MIGRATABLE" />
			<xs:enumeration value="CALLSTACK_USER" />
			<xs:enumeration value="CALLSTACK_KERNEL" />
			<xs:enumeration value="CGROUP_NS" />
			<xs:enumeration value="IPC_NS" />
			<xs:enumeration value="MNT_NS" />
			<xs:enumeration value="NET_NS" />
			<xs:enumeration value="PID_NS" />
			<xs:enumeration value="TIME_NS" />
			<xs:enumeration value="USER_NS" />
			<xs:enumeration value="UTS_NS" />
			<xs:enumeration value="UID" />
			<xs:enumeration value="EUID" />
			<xs:enumeration value="SUID" />
			<xs:enumeration value="GID" />
			<xs:enumeration value="EGID" />
			<xs:enumeration value="SGID" />
			<xs:enumeration value="VUID" />
			<xs:enumeration value="VEUID" />
			<xs:enumeration value="VSUID" />
			<xs:enumeration value="VGID" />
			<xs:enumeration value="VEGID" />
			<xs:enumeration value="VSGID" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to loglevel_string char * -->
	<xs:simpleType name="loglevel_string_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="" />
			<xs:enumeration value="TRACE_EMERG" />
			<xs:enumeration value="TRACE_ALERT" />
			<xs:enumeration value="TRACE_CRIT" />
			<xs:enumeration value="TRACE_ERR" />
			<xs:enumeration value="TRACE_WARNING" />
			<xs:enumeration value="TRACE_NOTICE" />
			<xs:enumeration value="TRACE_INFO" />
			<xs:enumeration value="TRACE_DEBUG_SYSTEM" />
			<xs:enumeration value="TRACE_DEBUG_PROGRAM" />
			<xs:enumeration value="TRACE_DEBUG_PROCESS" />
			<xs:enumeration value="TRACE_DEBUG_MODULE" />
			<xs:enumeration value="TRACE_DEBUG_UNIT" />
			<xs:enumeration value="TRACE_DEBUG_FUNCTION" />
			<xs:enumeration value="TRACE_DEBUG_LINE" />
			<xs:enumeration value="TRACE_DEBUG" />
			<xs:enumeration value="JUL_OFF" />
			<xs:enumeration value="JUL_SEVERE" />
			<xs:enumeration value="JUL_WARNING" />
			<xs:enumeration value="JUL_INFO" />
			<xs:enumeration value="JUL_CONFIG" />
			<xs:enumeration value="JUL_FINE" />
			<xs:enumeration value="JUL_FINER" />
			<xs:enumeration value="JUL_FINEST" />
			<xs:enumeration value="JUL_ALL" />
			<xs:enumeration value="LOG4J_OFF" />
			<xs:enumeration value="LOG4J_FATAL" />
			<xs:enumeration value="LOG4J_ERROR" />
			<xs:enumeration value="LOG4J_WARN" />
			<xs:enumeration value="LOG4J_INFO" />
			<xs:enumeration value="LOG4J_DEBUG" />
			<xs:enumeration value="LOG4J_TRACE" />
			<xs:enumeration value="LOG4J_ALL" />
			<xs:enumeration value="PYTHON_CRITICAL" />
			<xs:enumeration value="PYTHON_ERROR" />
			<xs:enumeration value="PYTHON_WARNING" />
			<xs:enumeration value="PYTHON_INFO" />
			<xs:enumeration value="PYTHON_DEBUG" />
			<xs:enumeration value="PYTHON_NOTSET" />
			<xs:enumeration value="UNKNOWN" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to enum lttng_rotation_state -->
	<xs:simpleType name="rotation_state_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="ONGOING" />
			<xs:enumeration value="COMPLETED" />
			<xs:enumeration value="EXPIRED" />
			<xs:enumeration value="ERROR" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to enum lttng_trace_archive_location_relay_protocol_type -->
	<xs:simpleType name="location_relay_protocol_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="TCP" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_calibrate_type enum -->
	<xs:simpleType name="calibrate_type_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="FUNCTION" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_event_rule_kernel_syscall_emission_site enum -->
	<xs:simpleType name="event_rule_kernel_syscall_emission_site">
		<xs:restriction base="xs:string">
			<xs:enumeration value="entry+exit" />
			<xs:enumeration value="entry" />
			<xs:enumeration value="exit" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_userspace_probe_location_function_instrumentation_type enum -->
	<xs:simpleType name="userspace_probe_location_function_instrumentation">
		<xs:restriction base="xs:string">
			<xs:enumeration value="ENTRY" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_userspace_probe_location_lookup_method enum -->
	<xs:simpleType name="userspace_probe_location_lookup_method">
		<xs:restriction base="xs:string">
			<xs:enumeration value="FUNCTION-DEFAULT" />
			<xs:enumeration value="FUNCTION-ELF" />
			<xs:enumeration value="TRACEPOINT-SDT" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_event_probe_attr struct -->
	<xs:complexType name="event_probe_attributes_type">
		<xs:all>
			<xs:element name="address" type="tns:uint64_type" minOccurs="0" />
			<xs:element name="offset" type="tns:uint64_type" minOccurs="0" />
			<xs:element name="symbol_name" type="tns:name_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to the lttng_event_function_attr struct -->
	<xs:complexType name="event_ftrace_attributes_type">
		<xs:all>
			<xs:element name="symbol_name" type="tns:name_type" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to per event type configuration -->
	<xs:complexType name="event_attributes_type">
		<xs:choice>
			<xs:element name="probe_attributes" type="tns:event_probe_attributes_type" />
			<xs:element name="function_attributes" type="tns:event_ftrace_attributes_type" />
		</xs:choice>
	</xs:complexType>

	<!-- Maps to exclusion type -->
	<xs:complexType name="event_exclusion_list_type">
		<xs:sequence>
			<xs:element name="exclusion" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to lttng_event struct -->
	<xs:complexType name="event_type">
		<xs:all>
			<xs:element name="type" type="tns:event_type_type" default="TRACEPOINT" minOccurs="0" />
			<xs:element name="name" type="tns:name_type" minOccurs="0" />
			<xs:element name="loglevel_type" type="tns:loglevel_type" default="ALL" minOccurs="0" />
			<xs:element name="loglevel" type="tns:loglevel_string_type" default="" minOccurs="0" />
			<xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
			<xs:element name="filter_expression" type="xs:string" minOccurs="0" />
			<xs:element name="exclusions" type="tns:event_exclusion_list_type" minOccurs="0"/>
			<xs:element name="attributes" type="tns:event_attributes_type" minOccurs="0" />
			<xs:element name="event_fields" type="tns:event_fields_type" minOccurs="0" />
			<xs:element name="success" type="xs:boolean" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to mi_lttng_version struct -->
	<xs:complexType name="version_type">
		<xs:all>
			<xs:element name="name" type="tns:name_type" />
			<xs:element name="string" type="tns:name_type" />
			<xs:element name="major" type="tns:uint32_type" />
			<xs:element name="url" type="xs:string" />
			<xs:element name="minor" type="tns:uint32_type" />
			<xs:element name="commit" type="xs:string" />
			<xs:element name="license" type="xs:string" />
			<xs:element name="patchLevel" type="tns:uint32_type" />
			<xs:element name="description" type="xs:string" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to an array of event -->
	<xs:complexType name="event_list_type">
		<xs:sequence>
			<xs:element name="event" type="tns:event_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to the lttng_domain_type enum -->
	<xs:simpleType name="domain_type_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="KERNEL"/>
			<xs:enumeration value="UST"/>
			<xs:enumeration value="JUL"/>
			<xs:enumeration value="LOG4J"/>
			<xs:enumeration value="PYTHON"/>
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_buffer_type enum -->
	<xs:simpleType name="domain_buffer_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="PER_PID"/>
			<xs:enumeration value="PER_UID"/>
			<xs:enumeration value="GLOBAL"/>
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the type mode of a channel -->
	<xs:simpleType name="channel_overwrite_mode_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="DISCARD" />
			<xs:enumeration value="OVERWRITE" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to the lttng_event_output enum -->
	<xs:simpleType name="event_output_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="SPLICE" />
			<xs:enumeration value="MMAP" />
		</xs:restriction>
	</xs:simpleType>

	<!-- map to a pid -->
	<xs:complexType name="pid_type">
		<xs:all>
			<xs:element name="id" type="xs:int" />
			<xs:element name="name" type="tns:name_type" />
			<xs:element name="events" type="tns:event_list_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- maps to an array of pid -->
	<xs:complexType name="pids_type">
		<xs:sequence>
			<xs:element name="pid" type="tns:pid_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:simpleType name="pidbyint">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="4294967295" />
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="pid_value_type_choice">
		<xs:choice>
			<xs:element name="id" type="tns:pidbyint" />
			<xs:element name="all" type="xs:boolean" />
		</xs:choice>
	</xs:complexType>

	<xs:complexType name="pid_value_type">
		<xs:all>
			<xs:element name="type" type="tns:pid_value_type_choice" />
			<xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a list of pid_process_attr_values-->
	<xs:complexType name="pid_process_attr_values_type">
		<xs:sequence>
			<xs:element name="pid" type="tns:pid_value_type" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a pid_tracker-->
	<xs:complexType name="pid_process_attr_tracker_type">
		<xs:all>
			<xs:element name="process_attr_values" type="tns:pid_process_attr_values_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<xs:simpleType name="vpidbyint">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="4294967295" />
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="vpid_value_type_choice">
		<xs:choice>
			<xs:element name="id" type="tns:vpidbyint" />
			<xs:element name="all" type="xs:boolean" />
		</xs:choice>
	</xs:complexType>

	<xs:complexType name="vpid_value_type">
		<xs:all>
			<xs:element name="type" type="tns:vpid_value_type_choice" minOccurs="0" maxOccurs="1" />
			<xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a list of vpid_process_attr_values-->
	<xs:complexType name="vpid_process_attr_values_type">
		<xs:sequence>
			<xs:element name="vpid" type="tns:vpid_value_type" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a vpid_tracker-->
	<xs:complexType name="vpid_process_attr_tracker_type">
		<xs:all>
			<xs:element name="process_attr_values" type="tns:vpid_process_attr_values_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<xs:simpleType name="uidbyint">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="4294967295" />
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="uid_value_type_choice">
		<xs:choice>
			<xs:element name="id" type="tns:uidbyint" />
			<xs:element name="name" type="xs:string" />
			<xs:element name="all" type="xs:boolean" />
		</xs:choice>
	</xs:complexType>

	<xs:complexType name="uid_value_type">
		<xs:all>
			<xs:element name="type" type="tns:uid_value_type_choice" minOccurs="0" maxOccurs="1" />
			<xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a list of uid_process_attr_values-->
	<xs:complexType name="uid_process_attr_values_type">
		<xs:sequence>
			<xs:element name="uid" type="tns:uid_value_type" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a uid_process_attr_tracker-->
	<xs:complexType name="uid_process_attr_tracker_type">
		<xs:all>
			<xs:element name="process_attr_values" type="tns:uid_process_attr_values_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<xs:simpleType name="vuidbyint">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="4294967295" />
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="vuid_value_type_choice">
		<xs:choice>
			<xs:element name="id" type="tns:vuidbyint" />
			<xs:element name="name" type="xs:string" />
			<xs:element name="all" type="xs:boolean" />
		</xs:choice>
	</xs:complexType>

	<xs:complexType name="vuid_value_type">
		<xs:all>
			<xs:element name="type" type="tns:vuid_value_type_choice" minOccurs="0" maxOccurs="1" />
			<xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a list of vuid_process_attr_values-->
	<xs:complexType name="vuid_process_attr_values_type">
		<xs:sequence>
			<xs:element name="vuid" type="tns:vuid_value_type" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a vuid_process_attr_tracker-->
	<xs:complexType name="vuid_process_attr_tracker_type">
		<xs:all>
			<xs:element name="process_attr_values" type="tns:vuid_process_attr_values_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<xs:simpleType name="gidbyint">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="4294967295" />
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="gid_value_type_choice">
		<xs:choice>
			<xs:element name="id" type="tns:gidbyint" />
			<xs:element name="name" type="xs:string" />
			<xs:element name="all" type="xs:boolean" />
		</xs:choice>
	</xs:complexType>

	<xs:complexType name="gid_value_type">
		<xs:all>
			<xs:element name="type" type="tns:gid_value_type_choice" minOccurs="0" maxOccurs="1" />
			<xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a list of gid_process_attr_values-->
	<xs:complexType name="gid_process_attr_values_type">
		<xs:sequence>
			<xs:element name="gid" type="tns:gid_value_type" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a gid_process_attr_tracker-->
	<xs:complexType name="gid_process_attr_tracker_type">
		<xs:all>
			<xs:element name="process_attr_values" type="tns:gid_process_attr_values_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<xs:simpleType name="vgidbyint">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="4294967295" />
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="vgid_value_type_choice">
		<xs:choice>
			<xs:element name="id" type="tns:vgidbyint" />
			<xs:element name="name" type="xs:string" />
			<xs:element name="all" type="xs:boolean" />
		</xs:choice>
	</xs:complexType>

	<xs:complexType name="vgid_value_type">
		<xs:all>
			<xs:element name="type" type="tns:vgid_value_type_choice" minOccurs="0" maxOccurs="1" />
			<xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a list of vgid_process_attr_values-->
	<xs:complexType name="vgid_process_attr_values_type">
		<xs:sequence>
			<xs:element name="vgid" type="tns:vgid_value_type" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a vgid_process_attr_tracker-->
	<xs:complexType name="vgid_process_attr_tracker_type">
		<xs:all>
			<xs:element name="process_attr_values" type="tns:vgid_process_attr_values_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a list of process_attr_trackers-->
	<xs:complexType name="process_attr_trackers_type">
		<xs:sequence>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element name="pid_process_attr_tracker" type="tns:pid_process_attr_tracker_type" maxOccurs="1" />
				<xs:element name="vpid_process_attr_tracker" type="tns:vpid_process_attr_tracker_type" maxOccurs="1" />
				<xs:element name="uid_process_attr_tracker" type="tns:uid_process_attr_tracker_type" maxOccurs="1" />
				<xs:element name="vuid_process_attr_tracker" type="tns:vuid_process_attr_tracker_type" maxOccurs="1" />
				<xs:element name="gid_process_attr_tracker" type="tns:gid_process_attr_tracker_type" maxOccurs="1" />
				<xs:element name="vgid_process_attr_tracker" type="tns:vgid_process_attr_tracker_type" maxOccurs="1" />
			</xs:choice>
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to struct lttng_domain and contains channels -->
	<xs:complexType name="domain_type">
		<xs:all>
			<xs:element name="type" type="tns:domain_type_type" />
			<xs:element name="buffer_type" type="tns:domain_buffer_type" />
			<xs:element name="pids" type="tns:pids_type" minOccurs="0" />
			<xs:element name="channels" type="tns:channels_type" minOccurs="0" />
			<xs:element name="events" type="tns:event_list_type" minOccurs="0" />
			<xs:element name="process_attr_trackers" type="tns:process_attr_trackers_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to struct lttng_channel -->
	<xs:complexType name="channel_type">
		<xs:all>
			<xs:element name="name" type="tns:name_type" />
			<xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0" />
			<xs:element name="attributes" type="tns:channel_attributes_type" minOccurs="0" />
			<xs:element name="events" type="tns:event_list_type" minOccurs="0" />
			<xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to struct lttng_channel_attr -->
	<xs:complexType name="channel_attributes_type">
		<xs:all>
			<xs:element name="overwrite_mode" type="tns:channel_overwrite_mode_type" default="DISCARD" minOccurs="0" />
			<xs:element name="subbuffer_size" type="tns:uint64_type" minOccurs="0" /> <!-- bytes -->
			<xs:element name="subbuffer_count" type="tns:uint64_type" default="4" minOccurs="0" />
			<xs:element name="switch_timer_interval" type="tns:uint32_type" default="0" minOccurs="0" />  <!-- usec -->
			<xs:element name="read_timer_interval" type="tns:uint32_type" />  <!-- usec -->
			<xs:element name="output_type" type="tns:event_output_type" />
			<xs:element name="tracefile_size" type="tns:uint64_type" default="0" minOccurs="0" /> <!-- bytes -->
			<xs:element name="tracefile_count" type="tns:uint64_type" default="0" minOccurs="0" />
			<xs:element name="live_timer_interval" type="tns:uint32_type" default="0" minOccurs="0" /> <!-- usec -->
			<xs:element name="discarded_events" type="tns:uint64_type" default="0" minOccurs="0" />
			<xs:element name="lost_packets" type="tns:uint64_type" default="0" minOccurs="0" />
			<xs:element name="monitor_timer_interval" type="tns:uint64_type" default="0" minOccurs="0" />
			<xs:element name="blocking_timeout" type="tns:blocking_timeout_type" default="0" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to struct lttng_snapshot_output -->
	<xs:complexType name="snapshot_type">
		<xs:all>
			<xs:element name="id" type="tns:uint32_type" minOccurs="0" />
			<xs:element name="max_size" type="tns:uint64_type" minOccurs="0" />
			<xs:element name="name" type="tns:name_type" minOccurs="0" />
			<xs:element name="session_name" type="tns:name_type" minOccurs="0" />
			<xs:element name="ctrl_url" type="xs:string" minOccurs="0" />
			<xs:element name="data_url" type="xs:string" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<xs:complexType name="snapshots_type">
		<xs:sequence>
			<xs:element name="snapshot" type="tns:snapshot_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="periodic_rotation_schedule_type">
		<xs:all>
			<xs:element name="time_us" type="tns:uint64_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<xs:complexType name="size_threshold_rotation_schedule_type">
		<xs:all>
			<xs:element name="bytes" type="tns:uint64_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<xs:complexType name="rotation_schedule_type">
		<xs:sequence>
			<xs:choice maxOccurs="unbounded">
				<xs:element name="periodic" type="tns:periodic_rotation_schedule_type" maxOccurs="unbounded" />
				<xs:element name="size_threshold" type="tns:size_threshold_rotation_schedule_type" maxOccurs="unbounded" />
			</xs:choice>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="channels_type">
		<xs:sequence>
			<xs:element name="channel" type="tns:channel_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a lttng_session -->
	<xs:complexType name="session_type">
		<xs:all>
			<xs:element name="name" type="tns:name_type" />
			<xs:element name="path" type="xs:string" minOccurs="0" />
			<xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
			<xs:element name="snapshot_mode" type="tns:uint32_type" minOccurs="0" />
			<xs:element name="live_timer_interval" type="tns:uint32_type" minOccurs="0" />
			<xs:element name="channels" type="tns:channels_type" minOccurs="0" />
			<xs:element name="domains" type="tns:domains_type" minOccurs="0" />
			<xs:element name="snapshots" type="tns:snapshots_type" minOccurs="0" />
			<xs:element name="rotation_schedules" type="tns:rotation_schedule_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_event_field -->
	<xs:complexType name="event_field_type">
		<xs:all>
			<xs:element name="name" type="tns:name_type" />
			<xs:element name="type" type="tns:event_field_type_type" />
			<xs:element name="nowrite" type="xs:int" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to the save command -->
	<xs:complexType name="save_type">
		<xs:all>
			<xs:element name="session" type="tns:session_type" />
			<xs:element name="path" type="xs:string" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to the load command -->
	<xs:complexType name="load_type">
		<xs:all>
			<xs:element name="session" type="tns:session_type" />
			<xs:element name="path" type="xs:string" />
			<xs:element name="overrides" type="tns:overrides_type" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to the override parameters of the load command -->
	<xs:complexType name="overrides_type">
		<xs:all>
			<xs:element name="name" type="tns:name_type" minOccurs="0" />
			<xs:element name="url" type="xs:string" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to struct lttng_calibrate -->
	<xs:complexType name="calibrate_type">
		<xs:all>
			<xs:element name="type" type="tns:calibrate_type_type" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to lttng_event_perf_counter_ctx -->
	<xs:complexType name="perf_counter_context_type">
		<xs:all>
			<xs:element name="type" type="tns:uint32_type" />
			<xs:element name="config" type="tns:uint64_type" />
			<xs:element name="name" type="tns:name_type" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to app_ctx -->
	<xs:complexType name="app_context_type">
		<xs:all>
			<xs:element name="provider_name" type="xs:string"/>
			<xs:element name="ctx_name" type="xs:string"/>
		</xs:all>
	</xs:complexType>

	<!-- Maps to lttng_event_context -->
	<xs:complexType name="context_type">
		<xs:sequence>
			<xs:choice>
				<xs:element name="type" type="tns:context_type_type"/>
				<xs:element name="perf" type="tns:perf_counter_context_type"/>
				<xs:element name="app" type="tns:app_context_type"/>
			</xs:choice>
			<xs:element name="symbol" type="xs:string" minOccurs="0" />
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to an array of domain -->
	<xs:complexType name="domains_type">
		<xs:sequence>
			<xs:element name="domain" type="tns:domain_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to an array of session -->
	<xs:complexType name="sessions_type">
		<xs:sequence>
			<xs:element name="session" type="tns:session_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to an array of event_field -->
	<xs:complexType name="event_fields_type">
		<xs:sequence>
			<xs:element name="event_field" type="tns:event_field_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to an array of context -->
	<xs:complexType name="contexts_type">
		<xs:sequence>
			<xs:element name="context" type="tns:context_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to an action during snapshot command -->
	<xs:complexType name="snapshot_cmd_type">
		<xs:sequence>
			<xs:element name="name" type="tns:snapshot_action_type" minOccurs="0" />
			<xs:element name="output" type="tns:output_type" minOccurs="0" />
		</xs:sequence>
	</xs:complexType>

	<!-- Type of snapshot commands -->
	<xs:simpleType name="snapshot_action_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="list-output" />
			<xs:enumeration value="del-output" />
			<xs:enumeration value="add-output" />
			<xs:enumeration value="record-output" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Maps to an action during metadata command -->
	<xs:complexType name="metadata_cmd_type">
		<xs:sequence>
			<xs:element name="name" type="tns:metadata_action_type" minOccurs="0" />
		</xs:sequence>
	</xs:complexType>

	<!-- Type of metadata commands -->
	<xs:simpleType name="metadata_action_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="regenerate" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Type of regenerate commands -->
	<xs:simpleType name="regenerate_action_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="metadata" />
			<xs:enumeration value="statedump" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Type of regenerate command -->
	<xs:complexType name="regenerate_cmd_type">
		<xs:sequence>
			<xs:element name="name" type="tns:regenerate_action_type" minOccurs="0" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="local_location_type">
		<xs:sequence>
			<xs:element name="absolute_path" type="xs:string" minOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="relay_location_type">
		<xs:sequence>
			<xs:element name="host" type="xs:string" minOccurs="1" />
			<xs:element name="control_port" type="xs:int" minOccurs="0" />
			<xs:element name="data_port" type="xs:int" minOccurs="0" />
			<xs:element name="protocol" type="tns:location_relay_protocol_type" minOccurs="1" />
			<xs:element name="relative_path" type="xs:string" minOccurs="0" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="location_type">
		<xs:choice>
			<xs:element name="local" type="tns:local_location_type" minOccurs="0" />
			<xs:element name="relay" type="tns:relay_location_type" minOccurs="0" />
		</xs:choice>
	</xs:complexType>

	<!-- Maps to the rotate command -->
	<xs:complexType name="rotate_type">
		<xs:sequence>
			<xs:element name="session_name" type="tns:name_type" minOccurs="1" />
			<xs:element name="state" type="tns:rotation_state_type" minOccurs="1" />
			<xs:element name="location" type="tns:location_type" minOccurs="0" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="rotation_schedule_result_type">
		<xs:sequence>
		  	<xs:element name="rotation_schedule" type="tns:rotation_schedule_type" minOccurs="1" />
			<xs:element name="success" type="xs:boolean" minOccurs="1"/>
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to the enable/disable-rotation commands -->
	<xs:complexType name="rotation_schedule_cmd_type">
		<xs:sequence>
			<xs:element name="session_name" type="tns:name_type" minOccurs="1" />
			<xs:element name="rotation_schedule_result" type="tns:rotation_schedule_result_type" minOccurs="1" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a lttng_rate_policy subtypes -->
	<xs:element name="rate_policy_sub_type" abstract="true"/>
	<xs:element name="rate_policy_every_n" type="tns:rate_policy_every_n_type" substitutionGroup="tns:rate_policy_sub_type" />
	<xs:element name="rate_policy_once_after_n" type="tns:rate_policy_once_after_n_type" substitutionGroup="tns:rate_policy_sub_type" />
	<xs:complexType name="rate_policy_every_n_type">
		<xs:all>
			<xs:element name="interval" type="tns:uint64_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>
	<xs:complexType name="rate_policy_once_after_n_type">
		<xs:all>
			<xs:element name="threshold" type="tns:uint64_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_rate_policy -->
	<xs:complexType name="rate_policy_type">
		<xs:all>
			<xs:element ref="tns:rate_policy_sub_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_action subtypes -->
	<xs:element name="action_sub_type" abstract="true"/>
	<xs:element name="action_list" type="tns:action_list_type" substitutionGroup="tns:action_sub_type" />
	<xs:element name="action_notify" type="tns:action_notify_type" substitutionGroup="tns:action_sub_type" />
	<xs:element name="action_rotate_session" type="tns:action_rotate_session_type" substitutionGroup="tns:action_sub_type" />
	<xs:element name="action_snapshot_session" type="tns:action_snapshot_session_type" substitutionGroup="tns:action_sub_type" />
	<xs:element name="action_start" type="tns:action_start_session_type" substitutionGroup="tns:action_sub_type" />
	<xs:element name="action_stop" type="tns:action_stop_session_type" substitutionGroup="tns:action_sub_type" />

	<!-- Maps to a lttng_action list -->
	<xs:complexType name="action_list_type">
		<xs:sequence>
			<xs:element name="action" type="tns:action_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a lttng_action notify -->
	<xs:complexType name="action_notify_type">
		<xs:all>
			<xs:element name="rate_policy" type="tns:rate_policy_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_action rotate session -->
	<xs:complexType name="action_rotate_session_type">
		<xs:all>
			<xs:element name="rate_policy" type="tns:rate_policy_type" minOccurs="1" />
			<xs:element name="session_name" type="xs:string" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to struct lttng_snapshot_output tailored to action MI printing, aka without lttng-sessiond state. -->
	<xs:complexType name="action_snapshot_output_type">
		<xs:all>
			<xs:element name="max_size" type="tns:uint64_type" minOccurs="0" />
			<xs:element name="name" type="tns:name_type" minOccurs="0" />
			<xs:element name="session_name" type="tns:name_type" minOccurs="0" />
			<xs:element name="ctrl_url" type="xs:string" minOccurs="0" />
			<xs:element name="data_url" type="xs:string" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_action snapshot session -->
	<xs:complexType name="action_snapshot_session_type">
		<xs:all>
			<xs:element name="rate_policy" type="tns:rate_policy_type" minOccurs="1" />
			<xs:element name="session_name" type="xs:string" minOccurs="1" />
			<xs:element name="output" type="tns:action_snapshot_output_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_action start session -->
	<xs:complexType name="action_start_session_type">
		<xs:all>
			<xs:element name="rate_policy" type="tns:rate_policy_type" minOccurs="1" />
			<xs:element name="session_name" type="xs:string" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_action stop session -->
	<xs:complexType name="action_stop_session_type">
		<xs:all>
			<xs:element name="rate_policy" type="tns:rate_policy_type" minOccurs="1" />
			<xs:element name="session_name" type="xs:string" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_action -->
	<xs:complexType name="action_type">
		<xs:all>
			<xs:element ref="tns:action_sub_type" minOccurs="1" />
			<xs:element name="error_query_results" type="tns:error_query_results_type" minOccurs="0"/>
		</xs:all>
	</xs:complexType>

	<!-- Maps to lttng_kernel_probe_location sub types -->
	<xs:element name="kernel_probe_location_sub_type" abstract="true"/>
	<xs:element name="kernel_probe_location_address" type="tns:kernel_probe_location_address_type" substitutionGroup="tns:kernel_probe_location_sub_type" />
	<xs:element name="kernel_probe_location_symbol_offset" type="tns:kernel_probe_location_symbol_offset_type" substitutionGroup="tns:kernel_probe_location_sub_type" />

	<!-- Maps to a lttng_kernel_probe_location_address. -->
	<xs:complexType name="kernel_probe_location_address_type">
		<xs:all>
			<xs:element name="address" type="tns:uint64_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_kernel_probe_location_symbol_offset_type. -->
	<xs:complexType name="kernel_probe_location_symbol_offset_type">
		<xs:all>
			<xs:element name="name" type="xs:string" minOccurs="1" />
			<xs:element name="offset" type="tns:uint64_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_kernel_probe_location. -->
	<xs:complexType name="kernel_probe_location_type">
		<xs:all>
			<xs:element ref="tns:kernel_probe_location_sub_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to lttng_user_probe_location sub types -->
	<xs:element name="userspace_probe_location_sub_type" abstract="true"/>
	<xs:element name="userspace_probe_location_function" type="tns:userspace_probe_location_function_type" substitutionGroup="tns:userspace_probe_location_sub_type" />
	<xs:element name="userspace_probe_location_tracepoint" type="tns:userspace_probe_location_tracepoint_type" substitutionGroup="tns:userspace_probe_location_sub_type" />

	<!-- Maps to lttng_userspace_probe_location_lookup_method sub type -->
	<xs:element name="userspace_probe_location_lookup_method_sub_type" abstract="true"/>
	<xs:element name="userspace_probe_location_lookup_method_function_default" substitutionGroup="tns:userspace_probe_location_lookup_method_sub_type"> <xs:complexType/> </xs:element>
	<xs:element name="userspace_probe_location_lookup_method_function_elf" substitutionGroup="tns:userspace_probe_location_lookup_method_sub_type"> <xs:complexType/> </xs:element>
	<xs:element name="userspace_probe_location_lookup_method_tracepoint_sdt" substitutionGroup="tns:userspace_probe_location_lookup_method_sub_type"> <xs:complexType/> </xs:element>

	<!-- Maps to a lttng_userspace_probe_location_lookup_method. -->
	<xs:complexType name="userspace_probe_location_lookup_method_type">
		<xs:all>
			<xs:element ref="tns:userspace_probe_location_lookup_method_sub_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

       	<!-- Maps to a lttng_userspace_probe_location_function. -->
	<xs:complexType name="userspace_probe_location_function_type">
		<xs:all>
			<xs:element name="name" type="xs:string" minOccurs="1" />
			<xs:element name="binary_path" type="xs:string" minOccurs="1" />
			<xs:element name="instrumentation_type" type="tns:userspace_probe_location_function_instrumentation" minOccurs="1" />
			<xs:element name="userspace_probe_location_lookup_method" type="tns:userspace_probe_location_lookup_method_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

       	<!-- Maps to a lttng_userspace_probe_location_tracepoint. -->
	<xs:complexType name="userspace_probe_location_tracepoint_type">
		<xs:all>
			<xs:element name="probe_name" type="xs:string" minOccurs="1" />
			<xs:element name="provider_name" type="xs:string" minOccurs="1" />
			<xs:element name="binary_path" type="xs:string" minOccurs="1" />
			<xs:element name="userspace_probe_location_lookup_method" type="tns:userspace_probe_location_lookup_method_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_userspace_probe_location. -->
	<xs:complexType name="userspace_probe_location_type">
		<xs:all>
			<xs:element ref="tns:userspace_probe_location_sub_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_log_level_rule subtypes -->
	<xs:element name="log_level_rule_sub_type" abstract="true"/>
	<xs:element name="log_level_rule_exactly" type="tns:log_level_rule_generic_type" substitutionGroup="tns:log_level_rule_sub_type" />
	<xs:element name="log_level_rule_at_least_as_severe_as" type="tns:log_level_rule_generic_type" substitutionGroup="tns:log_level_rule_sub_type" />

	<!-- Maps to a lttng_log_level_rule_*. -->
	<xs:complexType name="log_level_rule_generic_type">
		<xs:all>
			<xs:element name="level" type="xs:integer" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_log_level_rule. -->
	<xs:complexType name="log_level_rule_type">
		<xs:all>
			<xs:element ref="tns:log_level_rule_sub_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_event_rule subtypes -->
	<xs:element name="event_rule_sub_type" abstract="true"/>
	<xs:element name="event_rule_jul_logging" type="tns:event_rule_logging_type" substitutionGroup="tns:event_rule_sub_type" />
	<xs:element name="event_rule_kernel_kprobe" type="tns:event_rule_kernel_kprobe_type" substitutionGroup="tns:event_rule_sub_type" />
	<xs:element name="event_rule_kernel_syscall" type="tns:event_rule_kernel_syscall_type" substitutionGroup="tns:event_rule_sub_type" />
	<xs:element name="event_rule_kernel_tracepoint" type="tns:event_rule_kernel_tracepoint_type" substitutionGroup="tns:event_rule_sub_type" />
	<xs:element name="event_rule_kernel_uprobe" type="tns:event_rule_kernel_uprobe_type" substitutionGroup="tns:event_rule_sub_type" />
	<xs:element name="event_rule_log4j_logging" type="tns:event_rule_logging_type" substitutionGroup="tns:event_rule_sub_type" />
	<xs:element name="event_rule_python_logging" type="tns:event_rule_logging_type" substitutionGroup="tns:event_rule_sub_type" />
	<xs:element name="event_rule_user_tracepoint" type="tns:event_rule_user_tracepoint_type" substitutionGroup="tns:event_rule_sub_type" />

	<!-- Maps to a lttng_event_rule_kernel_kprobe. -->
	<xs:complexType name="event_rule_kernel_kprobe_type">
		<xs:all>
			<xs:element name="event_name" type="xs:string" minOccurs="1" />
			<xs:element name="kernel_probe_location" type="tns:kernel_probe_location_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_event_rule_kernel_syscall. -->
	<xs:complexType name="event_rule_kernel_syscall_type">
		<xs:all>
			<xs:element name="emission_site" type="tns:event_rule_kernel_syscall_emission_site" minOccurs="1" />
			<xs:element name="name_pattern" type="xs:string" minOccurs="1" />
			<xs:element name="filter_expression" type="xs:string" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_event_rule_kernel_tracepoint. -->
	<xs:complexType name="event_rule_kernel_tracepoint_type">
		<xs:all>
			<xs:element name="name_pattern" type="xs:string" minOccurs="1" />
			<xs:element name="filter_expression" type="xs:string" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_event_rule_kernel_uprobe. -->
	<xs:complexType name="event_rule_kernel_uprobe_type">
		<xs:all>
			<xs:element name="event_name" type="xs:string" minOccurs="1" />
			<xs:element name="userspace_probe_location" type="tns:userspace_probe_location_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>


	<!-- Maps to a lttng_event_rule_*_logging. -->
	<xs:complexType name="event_rule_logging_type">
		<xs:all>
			<xs:element name="name_pattern" type="xs:string" minOccurs="1" />
			<xs:element name="filter_expression" type="xs:string" minOccurs="0" />
			<xs:element name="log_level_rule" type="tns:log_level_rule_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to exclusion type -->
	<xs:complexType name="name_pattern_exclusions_type">
		<xs:sequence>
			<xs:element name="name_pattern_exclusion" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>


	<!-- Maps to a lttng_event_rule_user_tracepoint. -->
	<xs:complexType name="event_rule_user_tracepoint_type">
		<xs:all>
			<xs:element name="name_pattern" type="xs:string" minOccurs="1" />
			<xs:element name="filter_expression" type="xs:string" minOccurs="0" />
			<xs:element name="log_level_rule" type="tns:log_level_rule_type" minOccurs="0" />
			<xs:element name="name_pattern_exclusions" type="tns:name_pattern_exclusions_type" minOccurs="0" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_event_rule. -->
	<xs:complexType name="event_rule_type">
		<xs:all>
			<xs:element ref="tns:event_rule_sub_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_condition subtypes -->
	<xs:element name="condition_sub_type" abstract="true" />
	<xs:element name="condition_buffer_usage_high" type="tns:condition_buffer_usage_type" substitutionGroup="tns:condition_sub_type" />
	<xs:element name="condition_buffer_usage_low" type="tns:condition_buffer_usage_type" substitutionGroup="tns:condition_sub_type" />
	<xs:element name="condition_event_rule_matches" type="tns:condition_event_rule_matches_type" substitutionGroup="tns:condition_sub_type" />
	<xs:element name="condition_session_consumed_size" type="tns:condition_session_consumed_size_type" substitutionGroup="tns:condition_sub_type" />
	<xs:element name="condition_session_rotation_completed" type="tns:condition_session_rotation_type" substitutionGroup="tns:condition_sub_type" />
	<xs:element name="condition_session_rotation_ongoing" type="tns:condition_session_rotation_type" substitutionGroup="tns:condition_sub_type" />

	<!-- Allow expression of the threshold in ratio or in bytes -->
	<xs:element name="buffer_usage_threshold_sub_type" abstract="true" />
	<xs:element name="threshold_bytes" type="tns:uint64_type" substitutionGroup="tns:buffer_usage_threshold_sub_type" />
	<xs:element name="threshold_ratio" type="tns:ratio_type" substitutionGroup="tns:buffer_usage_threshold_sub_type" />

	<!-- Maps to a lttng_condition buffer usage for both low and high -->
	<xs:complexType name="condition_buffer_usage_type">
		<xs:all>
			<xs:element name="session_name" type="xs:string" minOccurs="1" />
			<xs:element name="channel_name" type="xs:string" minOccurs="1" />
			<xs:element name="domain" type="tns:domain_type_type" minOccurs="1" />
			<xs:element ref="tns:buffer_usage_threshold_sub_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to lttng_event_expr sub type -->
	<xs:element name="event_expr_sub_type" abstract="true" />
	<xs:element name="event_expr_payload_field" type="tns:event_expr_payload_field_type" substitutionGroup="tns:event_expr_sub_type" />
	<xs:element name="event_expr_channel_context_field" type="tns:event_expr_channel_context_field_type" substitutionGroup="tns:event_expr_sub_type" />
	<xs:element name="event_expr_app_specific_context_field" type="tns:event_expr_app_specific_context_field_type" substitutionGroup="tns:event_expr_sub_type" />
	<xs:element name="event_expr_array_field_element" type="tns:event_expr_array_field_element_type" substitutionGroup="tns:event_expr_sub_type" />

	<!-- Maps to lttng_event_expr payload_field -->
	<xs:complexType name="event_expr_payload_field_type">
		<xs:all>
			<xs:element name="name" type="xs:string" minOccurs="1" />
		</xs:all>
	</xs:complexType>
	<!-- Maps to lttng_event_expr context field -->
	<xs:complexType name="event_expr_channel_context_field_type">
		<xs:all>
			<xs:element name="name" type="xs:string" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to lttng_event_expr app_specific context field -->
	<xs:complexType name="event_expr_app_specific_context_field_type">
		<xs:all>
			<xs:element name="provider_name" type="xs:string" minOccurs="1" />
			<xs:element name="type_name" type="xs:string" minOccurs="1" />
		</xs:all>
	</xs:complexType>
	<!-- Maps to lttng_event_expr array field -->
	<xs:complexType name="event_expr_array_field_element_type">
		<xs:all>
			<xs:element name="index" type="tns:uint64_type" minOccurs="1" />
			<xs:element name="event_expr" type="tns:event_expr_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_event_expr -->
	<xs:complexType name="event_expr_type">
		<xs:all>
			<xs:element ref="tns:event_expr_sub_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to an array of lttng_event_expr aka capture descriptor -->
	<xs:complexType name="capture_descriptors_type">
		<xs:sequence>
			<xs:element name="event_expr" type="tns:event_expr_type" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a lttng_condition event rule matches -->
	<xs:complexType name="condition_event_rule_matches_type">
		<xs:all>
			<xs:element name="capture_descriptors" type="tns:capture_descriptors_type" minOccurs="1" />
			<xs:element name="event_rule" type="tns:event_rule_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_condition session consumed size -->
	<xs:complexType name="condition_session_consumed_size_type">
		<xs:all>
			<xs:element name="session_name" type="xs:string" minOccurs="1" />
			<xs:element name="threshold_bytes" type="tns:uint64_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_condition session consumed size -->
	<xs:complexType name="condition_session_rotation_type">
		<xs:all>
			<xs:element name="session_name" type="xs:string" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to a lttng_condition -->
	<xs:complexType name="condition_type">
		<xs:all>
			<xs:element ref="tns:condition_sub_type" minOccurs="1" />
			<xs:element name="error_query_results" type="tns:error_query_results_type" minOccurs="0"/>
		</xs:all>
	</xs:complexType>

	<!-- Maps to lttng_error_query_result sub type -->
	<xs:element name="error_query_result_sub_type" abstract="true" />
	<xs:element name="error_query_result_counter" type="tns:error_query_result_counter_type" substitutionGroup="tns:error_query_result_sub_type" />

	<!-- Maps to lttng_error_query_results -->
	<xs:complexType name="error_query_result_counter_type">
		<xs:all>
			<xs:element name="value" type="tns:uint64_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>

	<!-- Maps to lttng_error_query_result -->
	<xs:complexType name="error_query_result_type">
		<xs:all>
			<xs:element name="name" type="xs:string" minOccurs="1" />
			<xs:element name="description" type="xs:string" minOccurs="1" />
			<xs:element ref="tns:error_query_result_sub_type" minOccurs="1" />
		</xs:all>
	</xs:complexType>


	<!-- Maps to lttng_error_query_results -->
	<xs:complexType name="error_query_results_type">
		<xs:sequence>
			<xs:element name="error_query_result" type="tns:error_query_result_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<!-- Maps to a lttng_trigger -->
	<xs:complexType name="trigger_type">
		<xs:all>
			<xs:element name="action" type="tns:action_type" minOccurs="1" />
			<xs:element name="condition" type="tns:condition_type" minOccurs="1" />
			<xs:element name="name" type="xs:string" minOccurs="1" />
			<xs:element name="owner_uid" type="tns:uidbyint" minOccurs="1"/>
			<xs:element name="error_query_results" type="tns:error_query_results_type" minOccurs="0"/>
		</xs:all>
	</xs:complexType>

	<!-- Maps to lttng_triggers -->
	<xs:complexType name="triggers_type">
		<xs:sequence>
			<xs:element name="trigger" type="tns:trigger_type" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="output_type">
		<xs:choice>
			<xs:element name="calibrate" type="tns:calibrate_type" minOccurs="0" />
			<xs:element name="channel" type="tns:channel_type" minOccurs="0" />
			<xs:element name="channels" type="tns:channels_type" minOccurs="0" />
			<xs:element name="contexts" type="tns:contexts_type" minOccurs="0" />
			<xs:element name="domains" type="tns:domains_type" minOccurs="0" />
			<xs:element name="events" type="tns:event_list_type" minOccurs="0" />
			<xs:element name="load" type="tns:load_type" minOccurs="0" />
			<xs:element name="metadata_action" type="tns:metadata_cmd_type" minOccurs="0" />
			<xs:element name="process_attr_trackers" type="tns:process_attr_trackers_type" minOccurs="0" />
			<xs:element name="regenerate_action" type="tns:regenerate_cmd_type" minOccurs="0" />
			<xs:element name="rotation" type="tns:rotate_type" minOccurs="0" />
			<xs:element name="rotation_schedule_results" type="tns:rotation_schedule_cmd_type" minOccurs="0" />
			<xs:element name="save" type="tns:save_type" minOccurs="0" />
			<xs:element name="session" type="tns:session_type" minOccurs="0" />
			<xs:element name="sessions" type="tns:sessions_type" minOccurs="0" />
			<xs:element name="snapshot" type="tns:snapshot_type" minOccurs="0" />
			<xs:element name="snapshot_action" type="tns:snapshot_cmd_type" minOccurs="0" />
			<xs:element name="trigger" type="tns:trigger_type" minOccurs="0" />
			<xs:element name="triggers" type="tns:triggers_type" minOccurs="0" />
			<xs:element name="version" type="tns:version_type" minOccurs="0" />
		</xs:choice>
	</xs:complexType>

	<!-- Maps to the mi_lttng commands -->
	<xs:simpleType name="command_string_type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="add-context" />
			<xs:enumeration value="add-trigger" />
			<xs:enumeration value="calibrate" />
			<xs:enumeration value="clear" />
			<xs:enumeration value="create" />
			<xs:enumeration value="destroy" />
			<xs:enumeration value="disable-channel" />
			<xs:enumeration value="disable-event" />
			<xs:enumeration value="disable-rotation" />
			<xs:enumeration value="enable-channel" />
			<xs:enumeration value="enable-event" />
			<xs:enumeration value="enable-rotation" />
			<xs:enumeration value="list" />
			<xs:enumeration value="list-trigger" />
			<xs:enumeration value="load" />
			<xs:enumeration value="metadata" />
			<xs:enumeration value="regenerate" />
			<xs:enumeration value="remove-trigger" />
			<xs:enumeration value="rotate" />
			<xs:enumeration value="save" />
			<xs:enumeration value="set-session" />
			<xs:enumeration value="snapshot" />
			<xs:enumeration value="start" />
			<xs:enumeration value="stop" />
			<xs:enumeration value="track" />
			<xs:enumeration value="untrack" />
			<xs:enumeration value="version" />
		</xs:restriction>
	</xs:simpleType>

	<xs:element name="command">
		<xs:complexType>
			<xs:all>
				<xs:element name="name" type="tns:command_string_type" maxOccurs="1" />
				<xs:element name="output" type="tns:output_type" maxOccurs="1" />
				<xs:element name="success" type="xs:boolean" minOccurs="0" maxOccurs="1" />
			</xs:all>
			<xs:attribute name="schemaVersion" type="xs:string" use="required"/>
		</xs:complexType>
	</xs:element>
</xs:schema>
