<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> > Creating the metadata is one of the first actions a plugin<br>
> must do<br>
> ><br>
> > Okay.<br>
> ><br>
> > I sent you one metadata file which had 1160 events. So should I<br>
> add the<br>
> > rtems 512 events in metadata?<br>
> <br>
> At the moment a detailed description of individual events is not<br>
> necessary. We have to get the basics in place first. So for now an 10<br>
> bit event number is enough.<br>
> <br>
> in recorddata.h I can see that out of 32 bits 10 bits are reserved for <br>
> event and 22 bits are reserved for time of the event.<br>
> With event number you mean 10 bits reserved for events?<br>
<br>
Yes.<br></blockquote><div>Okay. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> <br>
> <br>
> ><br>
> > The problem I am facing here is how to relate the metadata file with<br>
> > rtems event record item?<br>
> <br>
> This depends on what you want to do. It seems the babeltrace plugin<br>
> is a<br>
> bit too complex to write at the moment. Maybe we should start with<br>
> something simpler.<br>
> <br>
> The record client in your rtems-tools repository does the following:<br>
> <br>
> target --> TCP stream with struct rtems_record_items -> client -><br>
> conversion -> human readable text<br>
> <br>
> Okay<br>
> <br>
> <br>
> We should turn this into:<br>
> <br>
> target --> TCP stream with struct rtems_record_items -> client -><br>
> conversion -><br>
> <br>
> Okay up to this everything is working fine .<br>
> <br>
> CTF (metadata + event stream) -> files -> babeltrace -><br>
> human readable text<br>
> <br>
> We have to deal with this.<br>
> <br>
> <br>
> So the first thing we have to figure out is how babeltrace reads an<br>
> arbitrary CTF session (metadata + event stream).<br>
> <br>
> <br>
> The next thing is to look at and modify print_item() in<br>
> misc/record/record-main.c. In this function you get one client_item<br>
> after another.<br>
> <br>
> typedef struct client_item {<br>
> union {<br>
> SLIST_ENTRY( client_item ) free_node;<br>
> RB_ENTRY( client_item ) active_node;<br>
> };<br>
> uint64_t ns;<br>
> uint32_t cpu;<br>
> rtems_record_event event;<br>
> uint64_t data;<br>
> uint64_t counter;<br>
> } client_item;<br>
> <br>
> We are only interested in ns, cpu, event and data. So just convert<br>
> this to<br>
> <br>
> typedef struct {<br>
> uint64_t ns;<br>
> uint32_t cpu;<br>
> rtems_record_event event;<br>
> uint64_t data;<br>
> } ctf_event;<br>
> <br>
> If we are removing SLIST_ENTRY( client_item ) and RB_ENTRY( client_item <br>
> ) then we will also have to remove it's SLIST_HEAD(), RB_HEAD() etc.<br>
<br>
What do you mean with "remove it's SLIST_HEAD(), RB_HEAD() etc."?<br></blockquote><div>Okay. I saw it wrong. I thought these are dependent on SLIST_ENTRY( client_item ) and RB_ENTRY( client_item).</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
In print_item() you get a client_item which contains also implementation <br>
details of the client (the nodes and the counter). These members are not <br>
relevant for the converted event stream.<br></blockquote><div>Okay </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> <br>
> <br>
> and append this item into a file (the event stream file). For this<br>
> ctf_event you need a TSDL metadata. Save this metadata file.<br>
> <br>
> I have tried babeltrace example [1]. The babeltrace was using generated <br>
> metadata file.<br>
> We can also try barectf. It just needs yaml file which generated c code.<br>
<br>
Why do we need additional tools here? Is it not sufficient to generate <br>
the metadata in plain text format and save the event stream as binary data?<br></blockquote><div>I was just trying barectf yesterday. I was able to generate metadata file with it. YAML file is very easy to write. I used "barectf config.yaml -m ctf" command.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> <br>
> <br>
> Import the metadata and event stream in babeltrace and let it print a<br>
> human readable form.<br>
> <br>
> Does this look like something you can do?<br>
> <br>
> Okay. I will try. This was very much helpful but I think babeltrace will <br>
> definitely need generated metadata file.<br>
> <br>
> [1] <a href="https://lists.rtems.org/pipermail/devel/2019-May/025921.html" rel="noreferrer" target="_blank">https://lists.rtems.org/pipermail/devel/2019-May/025921.html</a><br>
<br>
The metadata is a part of CTF, so everyone consuming CTF data needs it.<br></blockquote><div>Okay </div></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font size="4"><b>Ravindra Kumar Meena</b></font>,<div><span style="color:rgb(102,102,102)">B. Tech. Computer Science and Engineering,<br></span></div><div><span style="color:rgb(102,102,102)"><a href="https://www.iitism.ac.in/" style="color:rgb(17,85,204)" target="_blank">Indian Institute of Technology (Indian School of Mines)</a>, Dhanbad</span></div></div></div></div></div></div>