2 * Copyright (C) 2013 - Julien Desfossez <jdesfossez@efficios.com>
3 * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 * David Goulet <dgoulet@efficios.com>
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:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
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 THE
29 #include "compat/limits.h"
31 #define CTF_INDEX_MAGIC 0xC1F1DCC1
32 #define CTF_INDEX_MAJOR 1
33 #define CTF_INDEX_MINOR 1
34 #define CTF_INDEX_1_0_SIZE offsetof(struct ctf_packet_index, stream_instance_id)
37 * Header at the beginning of each index file.
38 * All integer fields are stored in big endian.
40 struct ctf_packet_index_file_hdr
{
44 /* size of struct ctf_packet_index, in bytes. */
45 uint32_t packet_index_len
;
46 } __attribute__((__packed__
));
49 * Packet index generated for each trace packet store in a trace file.
50 * All integer fields are stored in big endian.
52 struct ctf_packet_index
{
53 uint64_t offset
; /* offset of the packet in the file, in bytes */
54 uint64_t packet_size
; /* packet size, in bits */
55 uint64_t content_size
; /* content size, in bits */
56 uint64_t timestamp_begin
;
57 uint64_t timestamp_end
;
58 uint64_t events_discarded
;
60 /* CTF_INDEX 1.0 limit */
61 uint64_t stream_instance_id
; /* ID of the channel instance */
62 uint64_t packet_seq_num
; /* packet sequence number */
63 } __attribute__((__packed__
));
65 #endif /* LTTNG_INDEX_H */