Generate local kernel and UST indexes
[lttng-tools.git] / src / common / index / lttng-index.h
1 /*
2 * Copyright (C) 2013 - Julien Desfossez <jdesfossez@efficios.com>
3 * David Goulet <dgoulet@efficios.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License, version 2 only,
7 * as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19 #ifndef LTTNG_INDEX_H
20 #define LTTNG_INDEX_H
21
22 #include <limits.h>
23
24 #define INDEX_MAGIC "CTFIDX"
25 #define INDEX_MAJOR 1
26 #define INDEX_MINOR 0
27
28 /*
29 * Header at the beginning of each index file.
30 * All integer fields are stored in big endian.
31 */
32 struct lttng_packet_index_file_hdr {
33 char magic[6];
34 uint32_t index_major;
35 uint32_t index_minor;
36 } __attribute__((__packed__));
37
38 /*
39 * Packet index generated for each trace packet store in a trace file.
40 * All integer fields are stored in big endian.
41 */
42 struct lttng_packet_index {
43 uint64_t offset; /* offset of the packet in the file, in bytes */
44 uint64_t packet_size; /* packet size, in bits */
45 uint64_t content_size; /* content size, in bits */
46 uint64_t timestamp_begin;
47 uint64_t timestamp_end;
48 uint64_t events_discarded;
49 uint64_t stream_id;
50 } __attribute__((__packed__));
51
52 #endif /* LTTNG_INDEX_H */
This page took 0.029261 seconds and 4 git commands to generate.