GSoC Project | Basic Support for Trace Compass

Gedare Bloom gedare at rtems.org
Mon Jun 24 15:47:22 UTC 2019


On Mon, Jun 24, 2019 at 1:44 AM Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> On 24/06/2019 09:28, Ravindra Kumar Meena wrote:
> >
> >
> > On Mon, Jun 24, 2019 at 12:06 PM Sebastian Huber
> > <sebastian.huber at embedded-brains.de
> > <mailto:sebastian.huber at embedded-brains.de>> wrote:
> >
> >     On 24/06/2019 08:24, Ravindra Kumar Meena wrote:
> >      > *Plan of the week:*
> >      > Last I was able to store the event stream in the disk. Now, I
> >     plan to
> >      > convert the native stream into CTF format. Once the conversion is
> >     done
> >      > then I will make the metadata for the converted CTF format.
> >
> >     The metadata is an essential part of CTF, so you cannot to this after a
> >     conversion. The metadata must describe your event stream. Please read
> >     the CTF specification again:
> >
> >     https://diamon.org/ctf/
> >
> >     All what you need to know about the metadata is described in this
> >     specification in detail. You should be able to write the metadata
> >     for an
> >     event stream consisting of struct ctf_event items until this Wednesday
> >     so that babeltrace can read it.
> >
> >
> > Okay. I have figured out something very important.
> >
> > Babeltrace reads trace files only when the event stream file have ctf
> > magic number(0xc1fc1fc1) and stream id(0000 0000 0000 0000 0000 0000).
> >
> > The stream data we are generating does not have these. I manually added
> > these values in the stream file. Babeltrace was reading the trace stream.
> >
> > This reduced the babeltrace error from
> >
> > [error] Invalid magic number 0x30302E30 at packet 0 (file offset 0).
> > [error] Stream index creation error.
> > [error] Open file stream error.
> > [warning] [Context] Cannot open_trace of format ctf at path ctf.
> > [warning] [Context] cannot open trace "ctf" from ctf/ for reading.
> > [error] Cannot open any trace for reading.
> > [error] opening trace "ctf/" for reading.
> > [error] none of the specified trace paths could be opened.
> >
> > to
> >
> > [warning] Unknown value 155263 in enum.
> > 0 RTEMS_RECORDING_EVENT: { ns = 0, cpu = 0, events = ( <unknown> :
> > container = 155263 ), data = 0 }
> > [error] Event id 216 is outside range.
> > [error] Reading event failed.
> > Error printing trace.
> >
> > As you can see magic number and many others error are reduced. This
> > proves that we have to add ctf magic number(0xc1fc1fc1) and stream
> > id(0000 0000 0000 0000 0000 0000) in the generated stream file.
>
> Your metadata in "misc/ctf/metadata" has little to do with the event
> stream created by the record-client program. For example you don't write
> a packet header before the events. I would not try to solve these issues
> with trial and error. You really have to know how CTF works. So, please
> read the CTF specification again.
>
+1


https://diamon.org/ctf/#spec7 - "Magic number (CTF magic number:
0xC1FC1FC1) specifies that this is a CTF packet. This magic number is
optional ... Stream ID, used as reference to stream description in
metadata. This field is optional if there is only one stream
description"

These errors are caused by the metadata mismatch from the stream file,
not by babeltrace.  You need to write the metadata to match the trace
data / stream.

Gedare


More information about the devel mailing list