<div dir="auto">Hi Phil,<div dir="auto"><br></div><div dir="auto">Can you please estimate when version 2 will be released ?</div><div dir="auto"><br></div><div dir="auto">Can you please provide sample code that uses Babeltrace to read metadata, channel ?</div><div dir="auto"><br></div><div dir="auto">Thank you for the tip. You saved us many hours of work.</div><div dir="auto"><br></div><div dir="auto">Best regards,</div><div dir="auto">Zvika</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 13, 2019, 07:06 Philippe Proulx <<a href="mailto:eeppeliteloop@gmail.com">eeppeliteloop@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Jun 12, 2019 at 11:22 PM Zvi Vered <<a href="mailto:veredz72@gmail.com" target="_blank" rel="noreferrer">veredz72@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> I'm trying to read the file "metadata".<br>
> I read the struct:<br>
><br>
> struct metadata_packet_header {<br>
> uint32_t magic; /* 0x75D11D57 */<br>
> uint8_t uuid[16]; /* Unique Universal Identifier */<br>
> uint32_t checksum; /* 0 if unused */<br>
> uint32_t content_size; /* in bits */<br>
> uint32_t packet_size; /* in bits */<br>
> uint8_t compression_scheme; /* 0 if unused */<br>
> uint8_t encryption_scheme; /* 0 if unused */<br>
> uint8_t checksum_scheme; /* 0 if unused */<br>
> uint8_t major; /* CTF spec major version number */<br>
> uint8_t minor; /* CTF spec minor version number */<br>
> HEADER_END;<br>
> };<br>
><br>
> the magic is indeed 0x75D11D57.<br>
> What is next struct I should read ?<br>
> I would expect "packet context". Am I right ?<br>
> what struct is it ?<br>
><br>
> I want to write a simple babeltrace for windows.<br>
<br>
Not to discourage you, but I think you're only beginning a very long<br>
journey. Reading a CTF trace entails:<br>
<br>
1. Depacketize the metadata stream to get the metadata text.<br>
<br>
2. Parse the metadata text to get the appropriate trace, stream, clock,<br>
and event classes. That's a custom, and somewhat complex,<br>
domain-specific language called TSDL.<br>
<br>
3. Use the classes found in 2. to decode each data stream. This involves<br>
decoding integer fields with custom sizes (for example, a 27-bit<br>
unsigned integer field), dynamically finding the lengths of<br>
sequences and the selectors of variants, updating the stream's clock,<br>
and much more.<br>
<br>
4. Merge the events of the trace's data streams decoded in 3. to get a<br>
monotonic sequence of events.<br>
<br>
Add to this various fixes for known tracer bugs and support for features<br>
such as trace file rotation and tracing session rotation.<br>
<br>
Please don't attempt this.<br>
<br>
We are currently polishing the Babeltrace 2 project which does all that,<br>
and much more, for the Linux, macOS, and Windows platforms. Our goal is<br>
to offer a flexible, plugin-based framework to read, manipulate, and<br>
write traces in different formats.<br>
<br>
Phil<br>
<br>
> If I succeed, and you will find it relevant, I can upload this project.<br>
><br>
> Thank you in advance,<br>
> Zvika<br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="mailto:lttng-dev@lists.lttng.org" target="_blank" rel="noreferrer">lttng-dev@lists.lttng.org</a><br>
> <a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" rel="noreferrer noreferrer" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
</blockquote></div>