X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Findex%2Fctf-index.h;h=d60fe0b26bf9f0cdc4c790b03c25617fb1cced4b;hb=d1de950db2f48a6a2a00557cd8987198274e0e2b;hp=5d6bd80f4cf11b32ed81574141e4ed7c5854c33a;hpb=dcb1ae155da39c238179b145b51064d06506a4d3;p=deliverable%2Flttng-tools.git diff --git a/src/common/index/ctf-index.h b/src/common/index/ctf-index.h index 5d6bd80f4..d60fe0b26 100644 --- a/src/common/index/ctf-index.h +++ b/src/common/index/ctf-index.h @@ -25,7 +25,12 @@ #ifndef LTTNG_INDEX_H #define LTTNG_INDEX_H +#include +#include + +#include #include +#include #define CTF_INDEX_MAGIC 0xC1F1DCC1 #define CTF_INDEX_MAJOR 1 @@ -101,4 +106,16 @@ static inline uint32_t lttng_to_index_minor(uint32_t lttng_major, 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 */