--- /dev/null
+--- metadata
+/* CTF 1.8 */
+
+typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+};
+
+clock {
+ name = cycle_counter_test;
+ uuid = "5b59e7db-5e49-418a-9adf-e1adfdf571c4";
+ freq = 1000000000;
+};
+
+typealias integer { size = 8; align = 8; signed = false; map = clock.cycle_counter_test.value; } := cc_count_t;
+
+struct packet_context {
+ cc_count_t timestamp_begin;
+ cc_count_t timestamp_end;
+ uint8_t content_size;
+ uint8_t packet_size;
+};
+
+struct event_header {
+ uint8_t id;
+ cc_count_t timestamp;
+};
+
+stream {
+ event.header := struct event_header;
+ packet.context := struct packet_context;
+};
+
+event {
+ name = "first_trace_event";
+ id = 0;
+ fields := struct {
+ uint8_t value;
+ };
+};
+
+--- first_trace_stream_0
+!macro packet(ts_beg, event_id)
+ <beg>
+ [ ts_beg : 8] # timestamp begin
+ [ ts_beg + 1 : 8] # timestamp end
+ [8 * (end - beg) : 8] # content size in bits
+ [8 * (end - beg) : 8] # packet size in bits
+
+ [ event_id : 8] # event id
+ [ ts_beg : 8] # timestamp
+ [ 42 : 8] # value field
+ <end>
+!end
+
+{ p1_s0_ts = 10 }
+{ p2_s0_ts = 20 }
+
+<p1_s0>
+m:packet(p1_s0_ts, 0)
+<p1_s0_end>
+
+<p2_s0>
+m:packet(p2_s0_ts, 0)
+<p2_s0_end>
+
+--- index/first_trace_stream_0.idx
+!be
+
+[0xC1F1DCC1 : 32] # Magic number
+[ 1 : 32] # Major
+[ 0 : 32] # Minor
+[ 56 : 32] # Index entry size (56 bytes)
+
+# Packet 1
+!macro entry(beg_label, end_label, ts_beg)
+ [ beg_label : 64] # offset in bytes
+ [8 * (end_label - beg_label) : 64] # total size in bits
+ [8 * (end_label - beg_label) : 64] # content size in bits
+ [ ts_beg : 64] # timestamp begin
+ [ ts_beg + 1 : 64] # timestamp end
+ [ 0 : 64] # events discarded
+ [ 0 : 64] # stream class id
+!end
+
+m:entry(p1_s0, p1_s0_end, p1_s0_ts)
+m:entry(p2_s0, p2_s0_end, p2_s0_ts)
--- /dev/null
+--- metadata
+/* CTF 1.8 */
+
+typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+};
+
+clock {
+ name = cycle_counter_test;
+ uuid = "5b59e7db-5e49-418a-9adf-e1adfdf571c4";
+ freq = 1000000000;
+};
+
+typealias integer { size = 8; align = 8; signed = false; map = clock.cycle_counter_test.value; } := cc_count_t;
+
+struct packet_context {
+ cc_count_t timestamp_begin;
+ cc_count_t timestamp_end;
+ uint8_t content_size;
+ uint8_t packet_size;
+};
+
+struct event_header {
+ uint8_t id;
+ cc_count_t timestamp;
+};
+
+stream {
+ event.header := struct event_header;
+ packet.context := struct packet_context;
+};
+
+event {
+ name = "second_trace_event";
+ id = 0;
+ fields := struct {
+ uint8_t value;
+ };
+};
+
+--- second_trace_stream_0
+!macro packet(ts_beg, event_id)
+ <beg>
+ [ ts_beg : 8] # timestamp begin
+ [ ts_beg + 1 : 8] # timestamp end
+ [8 * (end - beg) : 8] # content size in bits
+ [8 * (end - beg) : 8] # packet size in bits
+
+ [ event_id : 8] # event id
+ [ ts_beg : 8] # timestamp
+ [ 123 : 8] # value field
+ <end>
+!end
+
+{ p1_s0_ts = 110 }
+{ p2_s0_ts = 120 }
+
+<p1_s0>
+m:packet(p1_s0_ts, 0)
+<p1_s0_end>
+
+<p2_s0>
+m:packet(p2_s0_ts, 0)
+<p2_s0_end>
+
+--- index/second_trace_stream_0.idx
+!be
+
+[0xC1F1DCC1 : 32] # Magic number
+[ 1 : 32] # Major
+[ 0 : 32] # Minor
+[ 56 : 32] # Index entry size (56 bytes)
+
+# Packet 1
+!macro entry(beg_label, end_label, ts_beg)
+ [ beg_label : 64] # offset in bytes
+ [8 * (end_label - beg_label) : 64] # total size in bits
+ [8 * (end_label - beg_label) : 64] # content size in bits
+ [ ts_beg : 64] # timestamp begin
+ [ ts_beg + 1 : 64] # timestamp end
+ [ 0 : 64] # events discarded
+ [ 0 : 64] # stream class id
+!end
+
+m:entry(p1_s0, p1_s0_end, p1_s0_ts)
+m:entry(p2_s0, p2_s0_end, p2_s0_ts)
--- /dev/null
+Trace class:
+ Stream class (ID 0):
+ Supports packets: Yes
+ Packets have beginning default clock snapshot: Yes
+ Packets have end default clock snapshot: Yes
+ Supports discarded events: No
+ Supports discarded packets: No
+ Default clock class:
+ Name: cycle_counter_test
+ Frequency (Hz): 1,000,000,000
+ Precision (cycles): 0
+ Offset (s): 0
+ Offset (cycles): 0
+ Origin is Unix epoch: No
+ UUID: 5b59e7db-5e49-418a-9adf-e1adfdf571c4
+ Event class `first_trace_event` (ID 0):
+ Payload field class: Structure (1 member):
+ value: Unsigned integer (8-bit, Base 10)
+
+[Unknown]
+{Trace 0, Stream class ID 0, Stream ID 1}
+Stream beginning:
+ Name: stream-1
+ Trace:
+ Stream (ID 1, Class ID 0)
+
+[10 cycles, 10 ns from origin]
+{Trace 0, Stream class ID 0, Stream ID 1}
+Packet beginning
+
+[10 cycles, 10 ns from origin]
+{Trace 0, Stream class ID 0, Stream ID 1}
+Event `first_trace_event` (Class ID 0):
+ Payload:
+ value: 42
+
+[11 cycles, 11 ns from origin]
+{Trace 0, Stream class ID 0, Stream ID 1}
+Packet end
+
+[20 cycles, 20 ns from origin]
+{Trace 0, Stream class ID 0, Stream ID 1}
+Packet beginning
+
+[20 cycles, 20 ns from origin]
+{Trace 0, Stream class ID 0, Stream ID 1}
+Event `first_trace_event` (Class ID 0):
+ Payload:
+ value: 42
+
+[21 cycles, 21 ns from origin]
+{Trace 0, Stream class ID 0, Stream ID 1}
+Packet end
+
+[40 cycles, 40 ns from origin]
+Message iterator inactivity:
+ Clock class:
+ Name: cycle_counter_test
+ Frequency (Hz): 1,000,000,000
+ Precision (cycles): 0
+ Offset (s): 0
+ Offset (cycles): 0
+ Origin is Unix epoch: No
+ UUID: 5b59e7db-5e49-418a-9adf-e1adfdf571c4
+
+[50 cycles, 50 ns from origin]
+Message iterator inactivity:
+ Clock class:
+ Name: cycle_counter_test
+ Frequency (Hz): 1,000,000,000
+ Precision (cycles): 0
+ Offset (s): 0
+ Offset (cycles): 0
+ Origin is Unix epoch: No
+ UUID: 5b59e7db-5e49-418a-9adf-e1adfdf571c4
+
+Trace class:
+ Stream class (ID 0):
+ Supports packets: Yes
+ Packets have beginning default clock snapshot: Yes
+ Packets have end default clock snapshot: Yes
+ Supports discarded events: No
+ Supports discarded packets: No
+ Default clock class:
+ Name: cycle_counter_test
+ Frequency (Hz): 1,000,000,000
+ Precision (cycles): 0
+ Offset (s): 0
+ Offset (cycles): 0
+ Origin is Unix epoch: No
+ UUID: 5b59e7db-5e49-418a-9adf-e1adfdf571c4
+ Event class `second_trace_event` (ID 0):
+ Payload field class: Structure (1 member):
+ value: Unsigned integer (8-bit, Base 10)
+
+[Unknown]
+{Trace 1, Stream class ID 0, Stream ID 3}
+Stream beginning:
+ Name: stream-3
+ Trace:
+ Stream (ID 3, Class ID 0)
+
+[85 cycles, 85 ns from origin]
+Message iterator inactivity:
+ Clock class:
+ Name: cycle_counter_test
+ Frequency (Hz): 1,000,000,000
+ Precision (cycles): 0
+ Offset (s): 0
+ Offset (cycles): 0
+ Origin is Unix epoch: No
+ UUID: 5b59e7db-5e49-418a-9adf-e1adfdf571c4
+
+[100 cycles, 100 ns from origin]
+Message iterator inactivity:
+ Clock class:
+ Name: cycle_counter_test
+ Frequency (Hz): 1,000,000,000
+ Precision (cycles): 0
+ Offset (s): 0
+ Offset (cycles): 0
+ Origin is Unix epoch: No
+ UUID: 5b59e7db-5e49-418a-9adf-e1adfdf571c4
+
+[110 cycles, 110 ns from origin]
+{Trace 1, Stream class ID 0, Stream ID 3}
+Packet beginning
+
+[110 cycles, 110 ns from origin]
+{Trace 1, Stream class ID 0, Stream ID 3}
+Event `second_trace_event` (Class ID 0):
+ Payload:
+ value: 123
+
+[111 cycles, 111 ns from origin]
+{Trace 1, Stream class ID 0, Stream ID 3}
+Packet end
+
+[120 cycles, 120 ns from origin]
+{Trace 1, Stream class ID 0, Stream ID 3}
+Packet beginning
+
+[120 cycles, 120 ns from origin]
+{Trace 1, Stream class ID 0, Stream ID 3}
+Event `second_trace_event` (Class ID 0):
+ Payload:
+ value: 123
+
+[120 cycles, 120 ns from origin]
+Message iterator inactivity:
+ Clock class:
+ Name: cycle_counter_test
+ Frequency (Hz): 1,000,000,000
+ Precision (cycles): 0
+ Offset (s): 0
+ Offset (cycles): 0
+ Origin is Unix epoch: No
+ UUID: 5b59e7db-5e49-418a-9adf-e1adfdf571c4
+
+[121 cycles, 121 ns from origin]
+{Trace 1, Stream class ID 0, Stream ID 3}
+Packet end
+
+[Unknown]
+{Trace 1, Stream class ID 0, Stream ID 3}
+Stream end
+
+[200 cycles, 200 ns from origin]
+Message iterator inactivity:
+ Clock class:
+ Name: cycle_counter_test
+ Frequency (Hz): 1,000,000,000
+ Precision (cycles): 0
+ Offset (s): 0
+ Offset (cycles): 0
+ Origin is Unix epoch: No
+ UUID: 5b59e7db-5e49-418a-9adf-e1adfdf571c4
+
+[Unknown]
+{Trace 0, Stream class ID 0, Stream ID 1}
+Stream end