/* CTF 1.8 */

typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
typealias integer { size = 16; align = 8; signed = false; } := uint16_t;
typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
typealias integer { size = 64; align = 8; signed = false; } := uint64_t;
typealias integer { size = 64; align = 8; signed = false; } := unsigned long;
typealias integer { size = 5; align = 1; signed = false; } := uint5_t;
typealias integer { size = 27; align = 1; signed = false; } := uint27_t;

trace {
	major = 1;
	minor = 8;
	uuid = "d2270f5a-7a70-4521-860b-954f054e046b";
	byte_order = le;
	packet.header := struct {
		uint32_t magic;
		uint8_t  uuid[16];
		uint32_t stream_id;
		uint64_t stream_instance_id;
	};
};

env {
	hostname = "raton";
	domain = "ust";
	tracer_name = "lttng-ust";
	tracer_major = 2;
	tracer_minor = 11;
};

clock {
	name = "monotonic";
	uuid = "c56ad62a-6a35-4722-9807-d8e0f118a367";
	description = "Monotonic Clock";
	freq = 1000000000; /* Frequency, in Hz */
	/* clock value offset from Epoch is: offset * (1/freq) */
	offset = 1563264475374722151;
};

typealias integer {
	size = 27; align = 1; signed = false;
	map = clock.monotonic.value;
} := uint27_clock_monotonic_t;

typealias integer {
	size = 32; align = 8; signed = false;
	map = clock.monotonic.value;
} := uint32_clock_monotonic_t;

typealias integer {
	size = 64; align = 8; signed = false;
	map = clock.monotonic.value;
} := uint64_clock_monotonic_t;

struct packet_context {
	uint64_clock_monotonic_t timestamp_begin;
	uint64_clock_monotonic_t timestamp_end;
	uint64_t content_size;
	uint64_t packet_size;
	uint64_t packet_seq_num;
	unsigned long events_discarded;
	uint32_t cpu_id;
};

struct event_header_compact {
	enum : uint5_t { compact = 0 ... 30, extended = 31 } id;
	variant <id> {
		struct {
			uint27_clock_monotonic_t timestamp;
		} compact;
		struct {
			uint32_t id;
			uint64_clock_monotonic_t timestamp;
		} extended;
	} v;
} align(8);

struct event_header_large {
	enum : uint16_t { compact = 0 ... 65534, extended = 65535 } id;
	variant <id> {
		struct {
			uint32_clock_monotonic_t timestamp;
		} compact;
		struct {
			uint32_t id;
			uint64_clock_monotonic_t timestamp;
		} extended;
	} v;
} align(8);

event {
	name = "lttng_ust_statedump:bin_info";
	id = 0;
	stream_id = 0;
	loglevel = 13;
	fields := struct {
		integer { size = 64; align = 8; signed = 0; encoding = none; base = 16; } _baddr;
		integer { size = 64; align = 8; signed = 0; encoding = none; base = 10; } _memsz;
		string _path;
		integer { size = 8; align = 8; signed = 0; encoding = none; base = 10; } _is_pic;
		integer { size = 8; align = 8; signed = 0; encoding = none; base = 10; } _has_build_id;
		integer { size = 8; align = 8; signed = 0; encoding = none; base = 10; } _has_debug_link;
	};
};

stream {
	id = 0;
	event.header := struct event_header_large;
	packet.context := struct packet_context;
	event.context := struct {
		integer { size = 32; align = 8; signed = 1; encoding = none; base = 10; } _vpid;
		integer { size = 64; align = 8; signed = 0; encoding = none; base = 16; } _ip;
	};
};

event {
	name = "my_provider:my_first_tracepoint";
	id = 1;
	stream_id = 0;
	loglevel = 13;
	fields := struct {
		string _my_string_field;
		integer { size = 32; align = 8; signed = 1; encoding = none; base = 10; } _my_integer_field;
	};
};

