|| ||Dave Nomura <firstname.lastname@example.org>|
|| ||[PATCH 0/2][RFC] user space instruction tracing|
|| ||Wed, 17 Oct 2007 13:54:22 -0700|
|| ||Maynard Johnson <email@example.com>|
[PATCH 0/2] Instruction tracing
This patch set provides the tapset required to support user space
instruction tracing and is only applicable to the x86 architecture. It
exploits the utrace mechanism for doing single-step instruction tracing.
Some language extensions have been discussed on the mailing list but
there have been no translator changes made. This patch only deals with
the tapset to support instruction tracing. The current proposal is to
have the following instruction tracing tapscript syntax:
The SystemTap translator will generate a trap handler routine for the
body of the probe. The body can employ any SystemTap language
constructs that doesn't assume
a particular PC context.
The body could use internal variables to distinguish different behavior
for different instruction tracing regions.
When the translator sees a single_step or block_step probe, it also inserts
in the module initialization code.
The current SystemTap support for uprobes is still non-symbolic, but it
can be used to turn on/off instruction tracing by making calls to the
usr_itrace_on:long (pid:long) (returns 1=SUCCESS, 0=FAILURE)
The example in [patch 2/2] shows how this can be done.
These patches are against:
2.6.23-rc5 (kernel containing utrace support)
but a RHEL5.1 system should contain all of the necessary kernel support.
I developed against version 0.6/0.129 built 2007-09-24
1. The version of uprobes in systemtap cvs/patches/uprobes/ should still
work fine. You can build uprobes into the kernel or as a module. If
you want the module version, you need to make sure your kernel has the
right exports. See README in that directory.
2. As of 10/08/07, the systemtap cvs view contains a working version of
uprobes. You can get a cvs view of systemtap's src directory, and build
and install systemtap as described in src/README. Assuming you have a
utrace-enabled kernel WITH APPROPRIATE EXPORTS (RHEL 5.1 needs to export
access_process_vm), stap will automatically build and insmod uprobes
when you run a stap script that uses uprobes. Or you can just
# cd src/runtime/uprobes
# insmod uprobes.ko
- add support for instruction tracing child threads
- add support for instruction tracing forked children
- add more useful instruction tracing output routines that can be called
from the single step instruction handler
- port to PPC
Summary of patches:
[patch 1/2] usr_itrace.stp
[patch 2/2] User Instruction Tracing Example