[ltt-dev] SystemTAP support in tracepoints
jistone at redhat.com
Mon Apr 11 17:19:08 EDT 2011
On 04/10/2011 10:44 AM, Mathieu Desnoyers wrote:
> Hi Josh,
> Following our discussion, I started to think about how we could be
> support the systemtap breakpoint approach in UST tracepoints.
Just to set the stage a little more for others, the discussion was about
finding compatibility between our respective developer APIs for
userspace tracing. LTTng has the UST tracepoints, which are similar in
API to the kernel tracepoints; SystemTap has SDT markers which are
intentionally source-compatible with DTrace SDT.
So while we're waiting for world domination by either API, it would be
nice if our respective tools could make use of the other's userspace
markers. On the SDT side, the platform coverage is already greater
between SystemTap and DTrace, with Linux, Solaris, FreeBSD, and OSX.
IMO that makes it an easier sell to upstream developers to insert these
markers. The challenge is how we can adjust the implementation so that
LTTng could link to these, hopefully without sacrificing the current
NOP-like dormant overhead.
Going the other direction, we can try to add metadata to UST such that
SystemTap can find and probe them too, as Mathieu started below...
> I created the following prototype that should let us handle a variable number of
> arguments. The "args" I get here from the args... parameter would be
> taken from the "TP_ARGS()" declaration in the TRACE_EVENT header. The
> code below is really just to see if it is doable at all.
If I understand what you have here, this creates a "__tracepoint_ip"
section which is just an array of tracepoint IPs, as well as asm
clobbers to keep the arguments and memory alive by the compiler.
What's missing is metadata giving a name of some sort to identify the
tracepoint, as well as metadata informing us about the arguments. We've
already solved these problems in SDT, so I think it would be much better
to just embed an SDT probe in there and call it a day.
AFAIK, the only roadblock is that our probes are argument-numbered
rather than variadic. I've been thinking for a while that it would be
nice if we had a variadic SDT macro, e.g. STAP_PROBEV, and then UST
could invoke it directly. Since you and I were brainstorming this,
here's a neat trick I found to count __VA_ARGS__:
I'm going to try to adapt that for SDT, so I'll post if I get it working...
More information about the lttng-dev