Re: Problems with pistachio

Ashford Nichols <[email protected]> Sat, 11 Jun 2011 15:07:50 -0700
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
--00504502cb16c667cc04a576ea66
Content-Type: text/plain; charset=ISO-8859-1

I attempted to use tracepoints to track down the problem, but unfortunately
there was nothing to track. Whenever I enable a tracepoint that interrupts
the execution flow, the code seems to work fine (i.e. I get all the
interrupts) but if I disable the the trace point the application goes back
to it's old, problematic state. Here is the slightly modified code:

#include <l4io.h>
#include <l4/ipc.h>
#include <l4/schedule.h>
#include <l4/thread.h>

int main(int argc, char** argv){
printf("application started\n");
L4_ThreadId_t root = L4_MyGlobalId(); //roottask
L4_ThreadId_t irq1 = L4_GlobalId(1, 1); //keyboard interrupt
L4_Time_t one_sec = L4_TimePeriod(1000000);
L4_ThreadId_t from;
L4_AssociateInterrupt(irq1, root);
while(1){
L4_Wait(&from);
if(from == irq1){
printf("interrupt received\n");
L4_LoadMR(0, 0);
L4_Send(from, one_sec); //here I'm assuming that 1 second is enough time
}
}
return 0;
}

And here is the output of the debugger with the "IPC_DETAIL" tracepoint
enabled:

>go
tcb ROOTTASK cpu 0: ipc receive phase curr = ROOTTASK from = ANY_THRD
---"KD# IPC_DETAILS"---
------------------------------(eip = f01073a6, esp = 000c8001)---
>go
tcb ROOTTASK cpu 0:ipc blocking receive (curr = ROOTTASK, from = ANY_THRD)
---"KD# IPC_DETAILS"---
------------------------------(eip = f01074f8, esp = 00000002)---
>go
tcb ROOTTASK cpu 0: ipc ROOTTASK received msg from IRQ_1 (virtual NIL_THRD)
---"KD# IPC_DETAILS"---
------------------------------(eip =f010761c, esp = 00000002)---
>go
interrupt received
tcb ROOTTASK cpu 0: ipc send phase curr = ROOTTASK, to = IRQ_1
--"KD# IPC_DETAILS"---
------------------------------(eip = f010713e, esp = 00000002)---
>go
tcb ROOTTASK cpu 0: ipc send finished curr = ROOTTASK to = IRQ_1 from_tid
NIL_THRD
---"KD# IPC_DETAILS"---
------------------------------(eip = f0107379, esp = 00000002)---
>go
tcb ROOTTASK cpu 0: ipc send finish curr = ROOTTASK to = NIL_THRD from_tid
ANY_THRD
---"KD# IPC_DETAILS"---
------------------------------(eip = f0107379, esp = 00000002)---

As you can see the application receives the interrupt and, continues this
process through it's execution.

Ashford

--00504502cb16c667cc04a576ea66
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I attempted to use tracepoints to track down the problem, but unfortunately=
 there was nothing to track. Whenever I enable a tracepoint that interrupts=
 the execution flow, the code seems to work fine (i.e. I get all the interr=
upts) but if I disable the the trace point the application goes back to it&=
#39;s old, problematic state. Here is the slightly modified code:<div>
<br></div><div><span class=3D"Apple-style-span" style=3D"border-collapse: c=
ollapse; font-family: arial, sans-serif; font-size: 13px; "><div><div>#incl=
ude &lt;l4io.h&gt;</div><div>#include &lt;l4/ipc.h&gt;</div><div>#include &=
lt;l4/schedule.h&gt;</div>
<div>#include &lt;l4/thread.h&gt;</div><div><br></div><div>int main(int arg=
c, char** argv){</div><div><span style=3D"white-space: pre-wrap; ">	</span>=
printf(&quot;application started\n&quot;);</div></div><div><span style=3D"w=
hite-space: pre-wrap; ">	</span>L4_ThreadId_t root =3D L4_MyGlobalId(); //r=
oottask</div>
<div><div><span style=3D"white-space: pre-wrap; ">	</span>L4_ThreadId_t irq=
1 =3D L4_GlobalId(1, 1); //keyboard interrupt</div></div><div><span style=
=3D"white-space: pre-wrap; ">	</span>L4_Time_t one_sec =3D L4_TimePeriod(10=
00000);</div>
<div><span style=3D"white-space: pre-wrap; ">	</span>L4_ThreadId_t from;</d=
iv><div><div><span style=3D"white-space: pre-wrap; ">	</span>L4_AssociateIn=
terrupt(irq1, root);</div><div><span style=3D"white-space: pre-wrap; ">	</s=
pan>while(1){</div>
</div><div><span style=3D"white-space: pre-wrap; ">		</span>L4_Wait(&amp;fr=
om);</div><div><span style=3D"white-space: pre-wrap; ">		</span>if(from =3D=
=3D irq1){</div><div><div><span style=3D"white-space: pre-wrap; ">			</span=
>printf(&quot;interrupt received\n&quot;);</div>
<div><span style=3D"white-space: pre-wrap; ">			</span>L4_LoadMR(0, 0);</di=
v></div><div><span style=3D"white-space: pre-wrap; ">			</span>L4_Send(from=
, one_sec); //here I&#39;m assuming that 1 second is enough time</div><div>
<span style=3D"white-space: pre-wrap; ">		</span>}</div><div><span style=3D=
"white-space: pre-wrap; ">	</span>}</div><div><span style=3D"white-space: p=
re-wrap; ">	</span>return 0;</div><div>}</div></span><div><br></div><div>An=
d here is the output of the debugger with the &quot;IPC_DETAIL&quot; tracep=
oint enabled:</div>
<div><br></div><div>&gt;go</div><div>tcb ROOTTASK cpu 0: ipc receive phase =
curr =3D ROOTTASK from =3D ANY_THRD</div><div>---&quot;KD# IPC_DETAILS&quot=
;---</div><div>------------------------------(eip =3D f01073a6, esp =3D 000=
c8001)---</div>
<div>&gt;go</div><div>tcb ROOTTASK cpu 0:ipc blocking receive (curr =3D ROO=
TTASK, from =3D ANY_THRD)</div><div>---&quot;KD# IPC_DETAILS&quot;---</div>=
<div>------------------------------(eip =3D f01074f8, esp =3D 00000002)---<=
/div>
<div>&gt;go</div><div>tcb ROOTTASK cpu 0: ipc ROOTTASK received msg from IR=
Q_1 (virtual NIL_THRD)</div><div>---&quot;KD# IPC_DETAILS&quot;---</div><di=
v>------------------------------(eip =3Df010761c, esp =3D 00000002)---</div=
>
<div>&gt;go</div><div>interrupt received</div><div>tcb ROOTTASK cpu 0: ipc =
send phase curr =3D ROOTTASK, to =3D IRQ_1</div><div>--&quot;KD# IPC_DETAIL=
S&quot;---</div><div>------------------------------(eip =3D f010713e, esp =
=3D 00000002)---</div>
<div>&gt;go</div><div>tcb ROOTTASK cpu 0: ipc send finished curr =3D ROOTTA=
SK to =3D IRQ_1 from_tid NIL_THRD</div><div>---&quot;KD# IPC_DETAILS&quot;-=
--</div><div>------------------------------(eip =3D f0107379, esp =3D 00000=
002)---</div>
<div>&gt;go</div><div>tcb ROOTTASK cpu 0: ipc send finish curr =3D ROOTTASK=
 to =3D NIL_THRD from_tid ANY_THRD</div><div>---&quot;KD# IPC_DETAILS&quot;=
---</div><div>------------------------------(eip =3D f0107379, esp =3D 0000=
0002)---</div>
<div><br></div><div>As you can see the application receives the interrupt a=
nd, continues this process through it&#39;s execution.</div><div><br></div>=
<div>Ashford</div></div>

--00504502cb16c667cc04a576ea66--