</xs:sequence>
</xs:complexType>
+ <!-- Maps to a lttng_event_rule. -->
+ <xs:complexType name="trace_format_descriptor_type">
+ <xs:all>
+ <xs:element ref="tns:trace_format_descriptor_sub_type" minOccurs="1" />
+ </xs:all>
+ </xs:complexType>
+
+ <!-- Maps to a lttng_trace_format_descriptor subtypes -->
+ <xs:element name="trace_format_descriptor_sub_type" abstract="true"/>
+ <xs:element name="ctf1" type="tns:trace_format_descriptor_ctf1_type" substitutionGroup="tns:trace_format_descriptor_sub_type" />
+ <xs:element name="ctf2" type="tns:trace_format_descriptor_ctf2_type" substitutionGroup="tns:trace_format_descriptor_sub_type" />
+
+ <!-- Maps to a lttng_trace_format_ctf1_descriptor. -->
+ <xs:complexType name="trace_format_descriptor_ctf1_type">
+ <xs:all>
+ <xs:element name="major" type="tns:uint64_type" minOccurs="1" />
+ <xs:element name="minor" type="tns:uint64_type" minOccurs="1" />
+ </xs:all>
+ </xs:complexType>
+
+ <!-- Maps to a lttng_trace_format_ctf2_descriptor. -->
+ <xs:complexType name="trace_format_descriptor_ctf2_type">
+ <xs:all>
+ <xs:element name="major" type="tns:uint64_type" minOccurs="1" />
+ <xs:element name="minor" type="tns:uint64_type" minOccurs="1" />
+ </xs:all>
+ </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="trace_format" type="tns:trace_format_descriptor_type" 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" />
#include <common/tracker.hpp>
#include <lttng/channel.h>
#include <lttng/snapshot-internal.hpp>
-
+#include <lttng/trace-format-descriptor-internal.hpp>
#define MI_SCHEMA_MAJOR_VERSION 4
#define MI_SCHEMA_MINOR_VERSION 1
struct lttng_session *session, int is_open)
{
int ret;
+ lttng_error_code ret_code;
+ struct lttng_trace_format_descriptor *trace_format_descriptor = nullptr;
LTTNG_ASSERT(session);
goto end;
}
+ ret_code = lttng_session_get_trace_format_descriptor(session, &trace_format_descriptor);
+ if (ret_code != LTTNG_OK) {
+ ret = -1;
+ goto end;
+ }
+
+ ret_code = reinterpret_cast<lttng::trace_format_descriptor *>(trace_format_descriptor)
+ ->mi_serialize(writer);
+ if (ret_code != LTTNG_OK) {
+ ret = -1;
+ goto end;
+ }
+
if (!is_open) {
/* Closing session element */
ret = mi_lttng_writer_close_element(writer);
}
end:
+ lttng_trace_format_descriptor_destroy(trace_format_descriptor);
return ret;
}