Track Program_Counter(PC)/regs of L4Linux Task

Martin Pohlack mp26 at
Tue Dec 13 10:50:54 CET 2005

Hi Julian,

that are a lot of questions which span quite same area.  I will try to
say something to some of them ...

> I am currently running L4Linux2.6.14 on the Fiasco l4v2 microkernel
> using i386 arch with mostly default configurations.  I need the ability
> to track the program counter and registers of all threads in the L4Linux
> task.  Here's exactly what I would like to be able to do from a
> monitoring L4 task:

I don't know what kind of cooperation between tasks you assume, but you
could try to instrument all tasks in the system to give you the required
information via shared memory, without hacking the kernel.

> -Obtain the PC/regs for the first thread (thread 0) for L4Linux just
> before the thread executes it's first instruction.  It would be nice to
> make the thread wait for a signal before beginning execution.

The registers before the first instruction seem to be useless.  IP and
SP are set via exregs, the rest should be execution defined.  You could
directly get IP and SP from the exregser.

> -Obtain the PC/regs for any additional thread created or any thread
> moved for L4Linux (i.e. from a l4_thread_ex_regs call) just before that
> thread executes.  Again, it would be nice to make that thread wait for a
> signal before beginning its execution.
> -Randomly preemptively obtain the PC/regs for all threads of L4Linux.

I don't know what you mean by "Randomly preemptively".

You could hack something in into the timeout interrupt handler of fiasco
and use somewhat random timeouts.

> -Obtain the PC/regs for all threads of L4Linux on demand.

Use exregs, for the IP, SP you can directly get the answer by issueing
-1, IIRC.  This should also explain your 0xffffffff below.

> -Receive notification of thread exit for all threads of L4Linux.

Hack a notification into the thread lib?  Maybe use the events server?


More information about the l4-hackers mailing list