<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"><br>I had a look at the metadata file:<br>
<br>
typedef enum events_e : uint64_t_be {<br></blockquote><div>Because I am passing the item->event value in big-endian byte order. This will take passed value in big-endian byte order.</div><div><br></div><div>Now metadata trace description is in little-endian</div><div><br></div><div>trace {<br> major = 1;<br> minor = 8;<br> byte_order = le;<br>};<br></div><div><br></div><div>It will instruct babeltrace to read the big-endian value in little-endian. Hence giving us the correct value.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Why is it like this? Your structure looks like this:<br>
<br>
typedef struct ctf_event {<br>
uint32_t event_id;<br>
uint64_t ns;<br>
uint32_t cpu;<br>
rtems_record_event event;<br>
uint64_t data;<br>
} ctf_event;</blockquote><div><br></div><div>If you carefully look at the event structure I defined in metadata. </div><div><br></div><div>event {<br> name = "RTEMS_RECORDING_EVENT";<br> id=0;<br> fields := struct {<br> timestamp_t ns;<br> uint32_t cpu;<br> rtems_record_event events;<br> uint64_t data;<br> };<br>};<br></div><div><br></div><div>I have defined id=0 here. This instructs babeltrace that new event has begun and from this point, there will be four values (ns, cpu, events, data). </div><div><br></div><div>Once the babeltrace has read the last value(data). It will again see event id equal 0 stating that new event has begun and again it will read four values.</div><div><br></div><div>It will become more clear if you see the generated trace in HEX format. I used Ghex software for the same.</div></div><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>