<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">This approach makes no sense to me.<br>
<br>
Per CPU you receive three record events in succession:<br>
<br>
[19:32:26.679099590] (+0.000046608) Record_Item RTEMS_RECORDING_EVENT: { <br>
cpu_id = 5 }, { event = ( "RTEMS_RECORD_THREAD_SWITCH_OUT" : container = <br>
216 ), data = 167837707 }<br>
[19:32:26.679099590] (+0.000000000) Record_Item RTEMS_RECORDING_EVENT: { <br>
cpu_id = 5 }, { event = ( "RTEMS_RECORD_THREAD_STACK_CURRENT" : <br>
container = 209 ), data = 32320 }<br>
[19:32:26.679099590] (+0.000000000) Record_Item RTEMS_RECORDING_EVENT: { <br>
cpu_id = 5 }, { event = ( "RTEMS_RECORD_THREAD_SWITCH_IN" : container = <br>
215 ), data = 151060501 }<br>
<br>
They have all the same timestamp.<br>
<br>
When you receive an RTEMS_RECORD_THREAD_SWITCH_OUT event, you store the <br>
timestamp (per CPU) and the data (per-CPU, this is the thread ID).<br>
<br>
When you receive an RTEMS_RECORD_THREAD_SWITCH_IN event and the <br>
timestamp matches, you use the values of the current event and the <br>
values stored before to output an LTTNG sched_switch event.<br></blockquote><div> </div><div>I am trying this approach but I think there is one problem with it. When RTEMS_RECORD_THREAD_SWITCH_IN event is received then there is no way to receive it's next_* values.</div><div><br></div><div>e.g.</div><div><br></div><div>ab //RTEMS_RECORD_THREAD_SWITCH_OUT</div><div>bc //RTEMS_RECORD_THREAD_STACK_CURRENT</div><div>cd //RTEMS_RECORD_THREAD_SWITCH_IN</div><div><br></div><div>Think this example as output in babeltrace where first character is of prev_comm value and second character is of next_comm value. Since we will be writing just after receiving c(third row) we can't get d values.</div><div><br></div><div>For this, we should have d value so that we can write it in RTEMS_RECORD_THREAD_SWITCH_IN event with next_comm value.</div><div><br></div><div> </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>