<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 17, 2019 at 1:45 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 16/06/2019 20:13, Ravindra Meena wrote:<br>
> ---<br>
> misc/CTF/record-ctf.ref | 55 +++++++++++++++++++++++++++++++++----------------<br>
> 1 file changed, 37 insertions(+), 18 deletions(-)<br>
> <br>
> diff --git a/misc/CTF/record-ctf.ref b/misc/CTF/record-ctf.ref<br>
> index a27757c..bdb9648 100644<br>
> --- a/misc/CTF/record-ctf.ref<br>
> +++ b/misc/CTF/record-ctf.ref<br>
[...]<br>
> clock {<br>
> - name = ctf_clock;<br>
> - freq = 1000;<br>
> - offset_s = 1421703448;<br>
> + name = ctf_clock; /* name of montonic clock */<br>
> + freq = 1000; /* frequency, in HZ */<br>
<br>
Why 1000Hz?<br></blockquote><div>The freq field is the initial frequency of the clock, in Hz. If the freq field is not present, the frequency is assumed to be 1000000000 (providing clock increment of 1 ns). I set to 1000HZ just for getting started.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> + offset_s = 1421703448;<br>
<br>
What is this for an offset?<br></blockquote><div>This offset is a difference between the beginning of clock and the actual start of the clock. The event will be recorded just after the offset.</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>
> + * A reference to the clock added within an integer type<br>
> + */<br>
> +<br>
> typealias integer {<br>
> size = 64;<br>
> map = clock.ctf_clock.value;<br>
> } := ctf_clock_int_t;<br>
<br>
Why does this start with "ctf_"?<br></blockquote><div>ctf_clock is the name of clock struct I created just above this. It is a reference to the clock name.</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>
> + * Trace stream packet having header and context.<br>
> + *<br>
> + * @param event.header includes id(unique identifier of stream) and timestamp.<br>
> + * @param packet.context includes clock timestamp, cpu id, event and event data.<br>
> + */<br>
> +<br>
> stream {<br>
> id = 0;<br>
> + event.header := struct {<br>
> + uint32_t id;<br>
<br>
What is this for an id?<br></blockquote><div>It is a unique identifier for stream header. There will be many streams so in order to identify the streams I have set the id here.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> + ctf_clock_int_t timestamp;<br>
<br>
Timestamp of what?<br></blockquote><div> It is the timestamp of the stream header. It is different from event header. The event heder can have a beginning and ending timestamp.</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>
> packet.context := struct {<br>
> ctf_clock_int_t timestamp;<br>
> uint32_t cpu;<br>
> uint32_t event;<br>
> uint64_t data;<br>
> };<br>
> - event.header := struct {<br>
> - uint32_t id;<br>
> - ctf_clock_int_t timestamp;<br>
> - };<br>
> };<br>
> <br>
> event {<br>
> - id = 0;<br>
> - name = "ctf_event";<br>
> - stream_id = 0;<br>
> + id = 0; /* event id<br>
> + name = "ctf_event"; /* event name */<br>
> + stream_id = 0; /* signifies stream id which event is supposed to concat with events */<br>
> fields := struct {<br>
> - uint32_t a;<br>
> - uint16_t b;<br>
> - string c;<br>
> + uint32_t a; /*event 1*/<br>
> + uint16_t b; /*event 2*/<br>
> + string c; /*event 3*/<br>
<br>
What are events 1, 2, 3?<br></blockquote><div>I have added this event just for getting started. I thought it would be better to get it reviewed this much TSDL code.</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>