Hello,
I am trying to log linux syscalls from l4linux2.6 on top of l4v2. What is the simplest way to log this at the IPC level (i have enabled exception IPC) and log all the parameters?
Thanks, Andrew
Andrew Davenport wrote:
Hello,
I am trying to log linux syscalls from l4linux2.6 on top of l4v2. What is the simplest way to log this at the IPC level (i have enabled exception IPC) and log all the parameters?
There are several approaches you might want to check out:
- Use IPC tracing in the kernel debugger, - Use rt_mon or its successor GRTMon to instrument l4linux code. There is a Diplomathesis about GRTMon "A Generalized Approach to Runtime Monitoring for Real-Time Systems" available from here: http://os/project/finished/finished.xml.de
I'm not sure whether grtmon is already in our remote CVS, but I don't see a reason why it could not be ...
Regards, Martin
Thanks Martin,
But I want this capability to be built into the kernel (l4 microkernel), and I would rather not use 3rd party packages. Right now Im logging in Thread::do_send. I get the trap state as such:
Trap_state *ts = (Trap_state*)_utcb_handler;
from there i get: Unsigned32 intNo = ts->err >> 3; and Unsigned32 eax = ts->eax, and so on for ebx, etc...
I am simply looking for an easy to filter out non-linux-syscalls so I only pay attention to linux syscalls. I think intNo gets changed somehow bc checking if (intNo == 80) does not log anything!
Thanks, Andrew
Quoting Martin Pohlack mp26@os.inf.tu-dresden.de:
Andrew Davenport wrote:
Hello,
I am trying to log linux syscalls from l4linux2.6 on top of l4v2. What is
the
simplest way to log this at the IPC level (i have enabled exception IPC) and
log
all the parameters?
There are several approaches you might want to check out:
- Use IPC tracing in the kernel debugger, - Use rt_mon or its successor GRTMon to instrument l4linux code. There is a Diplomathesis about GRTMon "A Generalized Approach to Runtime Monitoring for Real-Time Systems" available from here: http://os/project/finished/finished.xml.de
I'm not sure whether grtmon is already in our remote CVS, but I don't see a reason why it could not be ...
Regards, Martin
On Thu Jul 07, 2005 at 15:50:13 -0400, Andrew Davenport wrote:
But I want this capability to be built into the kernel (l4 microkernel), and I would rather not use 3rd party packages. Right now Im logging in Thread::do_send. I get the trap state as such:
Trap_state *ts = (Trap_state*)_utcb_handler;
from there i get: Unsigned32 intNo = ts->err >> 3; and Unsigned32 eax = ts->eax, and so on for ebx, etc...
I am simply looking for an easy to filter out non-linux-syscalls so I only pay attention to linux syscalls. I think intNo gets changed somehow bc checking if (intNo == 80) does not log anything!
The exception was an int80 if ts->trapno == 0xd and ts->err = 0x402
So this goes like this:
if (ts->trapno == 0xd && ts->err == 0x402) { /* int $0x80 exception */ Mword syscall_nr = ts->eax;
Mword param1 = ts->ebx; Mword param2 = ts->ecx; Mword param3 = ts->edx; Mword param4 = ts->esi; Mword param5 = ts->edi; Mword param6 = ts->ebp;
/* log something... */
}
How to do the logging itself is another issue. You're probably best off using the kernel provided stuff, like defining yourself a logging function for the trace buffer. Depends what you want to do with that data.
Adam
l4-hackers@os.inf.tu-dresden.de