<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">> + ctf_item.event = __builtin_bswap32( item->event );<br>
<br>
Why is there this byte swap?<br></blockquote><div><br></div><div>It will set its value in big-endian. Since this value will be passed as big-endian. I have defined the typealias for the same in the metadata.</div><div><br></div><div>typealias integer { size = 64; align = 8; signed = false; byte_order=be; } := uint64_t_be;<br></div><div><br></div><div>The trace description in our metadata is</div><div><br></div><div>trace {<br> major = 1;<br> minor = 8;<br> byte_order = le;<br>};<br></div><div><br></div><div>This defines that babeltrace has to read in little-endian byte order. Hence, giving out correct value.</div><div><br></div><div>So basically we are passing big-endian value so that babeltrace can read it in little-endian.</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>