X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf%2Fmetadata.h;h=1b78762b2a9e1da9a12dc793c10a92507b6b1558;hp=7923e65b48ae4fef7c31570063458d9c8294fb05;hb=c462e188f3e7819c7bc74f671038cdbf36e8c3c0;hpb=fe21b9435361899060af5ec3b42f2778b4dfbcdd diff --git a/include/babeltrace/ctf/metadata.h b/include/babeltrace/ctf/metadata.h index 7923e65b..1b78762b 100644 --- a/include/babeltrace/ctf/metadata.h +++ b/include/babeltrace/ctf/metadata.h @@ -17,44 +17,50 @@ * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include +#include +#include +#include +#include +#include +#include +#include +#include #include -struct ctf_trace; -struct ctf_stream; -struct ctf_event; - -struct ctf_trace { - struct declaration_scope *scope; /* root scope */ - GArray *streams; /* Array of struct ctf_stream */ - - uint64_t major; - uint64_t minor; - uint8_t uuid[16]; - uint64_t word_size; -}; - -struct ctf_stream { - struct declaration_scope *scope; /* parent is trace scope */ - GArray *events_by_id; /* Array of struct ctf_event indexed by id */ - GHashTable *event_quark_to_id; /* GQuark to numeric id */ +#define CTF_MAGIC 0xC1FC1FC1 +#define TSDL_MAGIC 0x75D11D57 - uint64_t stream_id; - struct declaration_struct *event_header; - struct declaration_struct *event_context; - struct declaration_struct *packet_context; +struct ctf_file_stream { + struct ctf_stream_definition parent; + struct ctf_stream_pos pos; /* current stream position */ }; +#define HEADER_END char end_field +#define header_sizeof(type) offsetof(typeof(type), end_field) -struct ctf_event { - struct declaration_scope *scope; /* parent is stream scope */ - GQuark name; - uint64_t id; /* Numeric identifier within the stream */ - uint64_t stream_id; - struct declaration_struct *context; - struct declaration_struct *fields; +struct metadata_packet_header { + uint32_t magic; /* 0x75D11D57 */ + uint8_t uuid[16]; /* Unique Universal Identifier */ + uint32_t checksum; /* 0 if unused */ + uint32_t content_size; /* in bits */ + uint32_t packet_size; /* in bits */ + uint8_t compression_scheme; /* 0 if unused */ + uint8_t encryption_scheme; /* 0 if unused */ + uint8_t checksum_scheme; /* 0 if unused */ + uint8_t major; /* CTF spec major version number */ + uint8_t minor; /* CTF spec minor version number */ + HEADER_END; }; #endif /* _BABELTRACE_CTF_METADATA_H */