advanced tracing API

David Howells (dhowells@redhat.com)
Wed, 28 Aug 2002 16:01:23 +0100


I've written an advanced tracing API as a potential replacement for ptrace. It
isn't quite complete yet, but sufficient functionality should exist to
implement strace.

It works by adding a new system call that deals with file descriptors with
"special" files attached (much as sysvipc shm does). The fds are, however,
exposed and can be polled. Each fd manages a thread group.

It has full support for threads created with CLONE_THREAD.

Documentation is included in the trace-2532 patch.

Comments would be appreciated.

It is available as a pair of patches to 2.5.32 plus a test/demo program:

ftp://infradead.org/pub/people/dwh/orn-2532.diff.bz2
ftp://infradead.org/pub/people/dwh/trace-2532.diff.bz2
ftp://infradead.org/pub/people/dwh/trctl2.c

Apply the orn-2532 and then the trace-2532 patches to a 2.5.32 kernel, build
and install. The trctl2 program needs access to the header files from the
patched kernel at the moment.

Run trctl2 under the patched kernel. It will fork off an "inferior" process
and begin trapping and displaying certain events from it. The inferior process
will then create a set of threads which will then also be managed by the
"debugger". These threads can be hit with signals to make events happen.

David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/