<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Dec 5, 2020, 12:14 AM Richi Dubey <<a href="mailto:richidubey@gmail.com" target="_blank" rel="noreferrer">richidubey@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Also,<div><br></div><div>The stack trace for the thread looks like this:</div><div><br></div><div>Tasks (entry function) -> rtems_task_wake_after ->_Thread_Dispatch_direct -> _Thread_Do_dispatch (where the _Context_switch function call lies), how can then the heir thread start executing from the _Thread_Handler? I do not see it in the trace at all.</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Maybe the stack trace isn't right. I saw case this week where the stack trace during system initialization doesn't work at all on a sync qemu.</div><div dir="auto"><br></div><div dir="auto">I'd recommend setting a breakpoint at thread handler and at the entry point of each of the threads just to confirm that what is supposed to happen is actually happening.</div><div dir="auto"><br></div><div dir="auto">--joel</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Dec 5, 2020 at 11:05 AM Richi Dubey <<a href="mailto:richidubey@gmail.com" rel="noreferrer noreferrer" target="_blank">richidubey@gmail.com</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"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I have currently no time to help you debugging this issue.</blockquote><div>Okay, even a hint would be helpful.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">returns to _Thread_Do_dispatch() or jumps to _Thread_Handler(). </blockquote><div>When does it return to _Thread_Do_dispatch() and when does it jump to _Thread_Handler() ? Is there a condition? How does it choose between what to do? </div><div> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 4, 2020 at 1:35 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" rel="noreferrer noreferrer" target="_blank">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 04/12/2020 08:56, Richi Dubey wrote:<br>
<br>
><br>
> When I am trying to debug tm24 running on the Strong APA scheduler <br>
> code, I can see that the thread which comes after the call <br>
> to _CPU_Context_switch, resumes execution from the same code (next <br>
> line in the _Thread_Do_dispatch function after _CPU_Context_switch), <br>
> whereas when the same code is run on a different scheduler (the <br>
> default sp scheduler) the heir thread that executes after the call <br>
> to _CPU_Context_switch starts executing from _Thread_Handler and does <br>
> not resume its execution from the _Thread_Do_dispatch (which has the <br>
> context_switch function call).<br>
><br>
> Why is this happening? Is the scheduler responsible for this?<br>
<br>
I have currently no time to help you debugging this issue.<br>
<br>
Each thread starts the execution in _Thread_Handler(). A context switch <br>
returns to _Thread_Do_dispatch() or jumps to _Thread_Handler(). The <br>
_Thread_Handler() completes the context switch, does some general calls <br>
to begin the thread execution and then calls the thread entry function.<br>
<br>
-- <br>
embedded brains GmbH<br>
Herr Sebastian HUBER<br>
Dornierstr. 4<br>
82178 Puchheim<br>
Germany<br>
email: <a href="mailto:sebastian.huber@embedded-brains.de" rel="noreferrer noreferrer" target="_blank">sebastian.huber@embedded-brains.de</a><br>
phone: +49-89-18 94 741 - 16<br>
fax: +49-89-18 94 741 - 08<br>
<br>
Registergericht: Amtsgericht München<br>
Registernummer: HRB 157899<br>
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler<br>
Unsere Datenschutzerklärung finden Sie hier:<br>
<a href="https://embedded-brains.de/datenschutzerklaerung/" rel="noreferrer noreferrer noreferrer" target="_blank">https://embedded-brains.de/datenschutzerklaerung/</a><br>
<br>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" rel="noreferrer noreferrer" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div></div></div>