Skip to contentSkip to conversation

advanced tracing API

DISCUSSION David Howells 1 participant 1 message Aug 28, 2002

lore
Share & tools
lore
#0 lore raw

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