<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">> What I understand from here is that _prev_state is the previous state of<br>
> the thread(TID)).<br>
<br>
Yes, but what is the meaning of these state values? We have to figure this out since we need a mapping from RTEMS thread states to these Linux thread states. Could you use an example trace from Linux to check if the information referenced in this email answer makes sense?<br></blockquote><div> </div>$ grep "#define TASK_" include/linux/sched.h<br>#define TASK_RUNNING 0x0000<br>#define TASK_INTERRUPTIBLE 0x0001<br>#define TASK_UNINTERRUPTIBLE 0x0002<br>#define TASK_PARKED 0x0040<br>#define TASK_DEAD 0x0080<br>#define TASK_WAKEKILL 0x0100<br>#define TASK_WAKING 0x0200<br>#define TASK_NOLOAD 0x0400<br>#define TASK_NEW 0x0800<br>#define TASK_STATE_MAX 0x1000<br>#define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)<br>#define TASK_STOPPED (TASK_WAKEKILL | __TASK_STOPPED)<br>#define TASK_TRACED (TASK_WAKEKILL | __TASK_TRACED)<br>#define TASK_IDLE (TASK_UNINTERRUPTIBLE | TASK_NOLOAD)<br>#define TASK_NORMAL (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)<br><div>#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ </div><div><br></div><div>In babeltrace output _prev_state have { 0, 1, 1026, 4096 } values.<br></div><div>If you have look at above #define <TASK_*>. They have been defined in hex format.</div><div>eg. </div><div>0 is 0x0000 which means TASK_RUNNING</div><div>1 is 0x0001 which means TASK_INTERRUPTIBLE</div><div>1026 in decimal is 0x402 which is 0x400 | 0x002. That is TASK_NOLOAD | TASK_UNINTERRUPTIBLE, or, as defined above, it's simply TASK_IDLE.<br></div><div><br></div><div>So in this way, all the prev_state are defined.</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>
>> It would be good to get task names for the IDs. Do you have an idea how<br>
>> we can do this?<br>
>><br>
> With task name do you mean RTEMS_RECORD_THREAD_SWITCH_IN<br>
> and RTEMS_RECORD_THREAD_SWITCH_OUT?<br>
> <br>
> if so this can be done by calling:<br>
> rtems_record_event_text( item->event )<br>
<br>
Attached is a patch for RTEMS. The record server sends all thread names to the client after the header.<br>
<br>
For thread name changes and new threads we have to think about.<br></blockquote><div>I applied the patch. The bootstrap worked successfully. I am not sure what I have to do with this.</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>