#ifndef LTTNG_INDEX_H
#define LTTNG_INDEX_H
+#include <common/compat/endian.h>
+#include <common/macros.h>
+
+#include <stdint.h>
#include <limits.h>
+#include <stddef.h>
#define CTF_INDEX_MAGIC 0xC1F1DCC1
#define CTF_INDEX_MAJOR 1
}
static inline uint32_t lttng_to_index_major(uint32_t lttng_major,
- uint32_t lttng_minor)
+ uint32_t lttng_minor __attribute__((unused)))
{
if (lttng_major == 2) {
return 1;
abort();
}
+static inline void ctf_packet_index_file_hdr_init(
+ struct ctf_packet_index_file_hdr *hdr,
+ uint32_t idx_major, uint32_t idx_minor)
+{
+ memset(hdr, 0, sizeof(*hdr));
+ hdr->magic = htobe32(CTF_INDEX_MAGIC);
+ hdr->index_major = htobe32(idx_major);
+ hdr->index_minor = htobe32(idx_minor);
+ hdr->packet_index_len = htobe32(
+ ctf_packet_index_len(idx_major, idx_minor));
+}
+
#endif /* LTTNG_INDEX_H */