<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">> Have made changes:<br>
> <a href="https://github.com/rmeena840/rtems-tools/commit/a6701361eab030698464bab67d63a880d503c90e" rel="noreferrer" target="_blank">https://github.com/rmeena840/rtems-tools/commit/a6701361eab030698464bab67d63a880d503c90e</a><br>
> <br>
> Have a look.<br>
> <br>
> The following line will give the same thread_name. There is no need to <br>
> reverse. I checked the output. The values are the same.<br>
> snprintf( item_name_str, sizeof( item_name_str ), "%08"PRIx64, <br>
> item->data );<br>
<br>
This change makes no sense.<br>
<br>
1. If you store data from a previous record item to use it in the <br>
future, then you must always store this information per-CPU. So, this <br>
thread_id_name must be per-CPU.<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>
2. Each of the RTEMS_RECORD_THREAD_NAME events, the item->data integer <br>
contains up to 4 or 8 chars.<br>
<br>
<a href="https://git.rtems.org/rtems/tree/cpukit/libtrace/record/record-userext.c#n54" rel="noreferrer" target="_blank">https://git.rtems.org/rtems/tree/cpukit/libtrace/record/record-userext.c#n54</a></blockquote><div>item->data integer can be converted into a string by calling snprintf(); Isn't it correct?</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>
3. You don't need extra memcpy() calls, just store the string directly <br>
in ctx->thread_names[api_id][thread_id]. The first <br>
RTEMS_RECORD_THREAD_NAME uses <br>
ctx->thread_names[api_id][thread_id][0..7], the second uses <br>
ctx->thread_names[api_id][thread_id][8..15]. The third and later are an <br>
error, just ignore it.<br></blockquote><div>We can store the 16 char all at once then why are we doing this in two parts.</div><div><br></div><div>My approach is like this:</div><div> </div><div>Get the api_id from thread_id and for the same api_id increase the thread_id counter and store the string whenever new RTEMS_RECORD_THREAD_NAME is received.</div><div>eg.</div><div><api_id=0><thread_id=0><thread_name></div><div><api_id=0><thread_id=1><thread_name><br></div><div><api_id=0><thread_id=2><thread_name><br></div><div><br></div><div><div><api_id=1><thread_id=0><thread_name></div><div><api_id=1><thread_id=1><thread_name><br></div><div><api_id=1><thread_id=2><thread_name></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>