I just pushed out support for kernel tracepoints in systemtap -- a copy
of the manpage section is included below for reference. Try this
command to see what's available in your kernel:
stap -l 'kernel.trace("*")'
On Fedora rawhide, the kernel does have tracepoints enabled, but the
kernel-devel package is missing the headers needed to define the
tracepoints. This has been fixed in the package spec now, so the next
kernel package should be ready to go. If you're impatient, you can also
grab the source rpm and copy include/trace into
RHEL5 U3 also contains tracepoints, and is also missing the headers from
kernel-devel. Again, copying the files from the source RPM should let
you use them now. I don't have an ETA for when the official package
might be updated though...
For other distributions or custom kernels, YMMV, but anything 2.6.28+
should have at least a few tracepoints available.
As always, any feedback is welcome...
This family of probe points hooks up to static probing trace-
points inserted into the kernel or modules. As with markers,
these tracepoints are special macro calls inserted by kernel de-
velopers to make probing faster and more reliable than with
DWARF-based probes, and DWARF debugging information is not re-
quired to probe tracepoints. Tracepoints have an extra advan-
tage of more strongly-typed parameters than markers.
Tracepoint probes begin with kernel. The next part names the
tracepoint itself: trace("name"). The tracepoint name string,
which may contain the usual wildcard characters, is matched
against the names defined by the kernel developers in the trace-
point header files.
The handler associated with a tracepoint-based probe may read
the optional parameters specified at the macro call site. These
are named according to the declaration by the tracepoint author.
For example, the tracepoint probe kernel.trace("sched_switch")
provides the parameters $rq, $prev, and $next. If the parameter
is a complex type, as in a struct pointer, then a script can ac-
cess fields with the same syntax as DWARF $target variables.
Also, tracepoint parameters cannot be modified, but in guru-mode
a script may modify fields of parameters.
The name of the tracepoint is available in $$name, and a string
of name=value pairs for all parameters of the tracepoint is
available in $$vars.