It is right but brings the overhead of a syscall.
If the tracing application catches all signals before delivering
them to the instrumented original handler there is no problem,
the catching code can reset PTRACE_SELF_ON before calling the
instrumented application's original handler.
The instrumented code will then bounce as expected.
I see this more like a security, the "bouncing" feature
is only enabled until next syscall or signal, never more.
This instrumentation method allows with this little patch to do
all the syscall and signal instrumentation in userland and inside the
address space of the instrumented application.
I expect we will have a big improvement of instrumenting tools like
- debugger, tracing tool,
- virtualization applications like UML
- High availability: checkpoint and restart, record and replay.
because of the reduction of IPC and task switch overhead.
Pierre
--
=============
Pierre Morel
RTOS and Embedded Linux
--