Features/SystemtapStaticProbes

From FedoraProject

Jump to: navigation, search

Contents

Systemtap Static Probes

Summary

Systemtap allows event tracing of programs when they have static probes inserted. This allows for tracing specifics of an application on a higher level that is meaningful to the application user so they don't have to know the exact source code details for tracing what is happening.

Owner

Current status

TODO

 * [PR10013] support ENABLED sdt probe macro
 * [PR10601] user-space deref/registers in loc2c (i386 mainly, but could affect x86_64 and other arches also)

Detailed Description

By packaging a new version of systemtap, that enables programs that already have static dtrace probe markers in their sources and by making those packages build depend on the new systemtap-sdt-devel package and recompiling them with probe points enabled, users of those packages will be able to trace any high level events that these packages provide.

Benefit to Fedora

It will be easier for developers and users to observe what is really happening on their system on a higher (application) level.

Scope

Currently identified packages:

postgresql

Tracking bug: https://bugzilla.redhat.com/show_bug.cgi?id=488941 Already able to build something that works with current rpm. Documentation: upstream docs Example: example trace Screencast: video presentation

xorg-x11-server

Need tweaks to systemtap to gen proper header from .d file. (upstream docs) - stan and/or rajan

java-1.6.0-openjdk

Tracking bug: https://bugzilla.redhat.com/show_bug.cgi?id=498109 Probably likewise, has .d files in there. (upstream docs) - stan and/or mjw Static probes ready, plus hotspot tapset, jni tapset and java backtraces pending upstream.

tcl

Tracking bug: https://bugzilla.redhat.com/show_bug.cgi?id=489017

Might need implementation of probe_ENABLED(), which is tracked upstream as http://sourceware.org/bugzilla/show_bug.cgi?id=10013

Firefox

Tracking bug: https://bugzilla.redhat.com/show_bug.cgi?id=496113

mysql

apachetop/httpd

Perl

perl-5.10.0: implemented as an out-of-tree patch to the core (5.10.1 has some, see INSTALL)

Python

Ideas for python probes:

PHP

Ruby

See http://ruby-dtrace.rubyforge.org/

Haskell

Notes

It seems as if several of the above were dtrace-instrumented in code that was never merged into the upstream versions of the package, but instead represented as run-time add-ons or private patches for Solaris distributions. Disappointing, but perhaps we can do better and engage the respective upstream teams. This will of course take time and panache.

At least the patches tend to be very small so we have some freedom to choose between approaches (adding STAP_PROBE/whatever hooks directly to the core upstream code; or fedora local patches; or add-on shared libraries like for php/httpd).

Another approach worth considering is adding tapsets that map process.mark() events to process.function/statement() to approximate the dtrace out-of-tree patches.

How To Test

Whether systemtap and static markers are working in general can be tested by installing systemtap, kernel-debuginfo and the systemtap-testsuite. Running sudo make installcheck in /usr/share/systemtap/testsuite

When applications get static markers enabled we should add them to a testing page listing:

Question: Is there a convention/template for adding such test pages for test days?
Answer: https://fedoraproject.org/wiki/QA/Test_Days/Create

User Experience

For packages that have static probes enabled users will be able to trace high-level events, like for example database transactions, through stap.

Dependencies

Contingency Plan

Even if all the tracing will not work, packages that are converted to provide static probes will not be impacted since the probe points have (near) zero overhead, so in the worse case some packages were recompiled to enable the feature, but users will still not be able to use it.

Documentation

The upstream wiki is the best description for now http://sourceware.org/systemtap/wiki/UsingStaticUserMarkers the systemtap list has an example on converting a package http://sourceware.org/ml/systemtap/2009-q1/msg00140.html

While working on this feature this section will be expanded to list packages that have probe points enabled and pointers to (upstream) package documentation on the probe names and semantics like for postgresql http://www.postgresql.org/docs/8.2/static/dynamic-trace.html

Release Notes

Systemtap has been extended to support user space tracing, and in particular to support static (dtrace compatible) markers enabled in various programs in Fedora 12. This enables users, developers and administrators a high level overview of what is going on with their system or deep down in a specific program or subsystem.

Systemtap comes with a tutorial, a language reference manual, a tapsets reference and an examples directory under /usr/share/doc/systemtap-?.?/

Comments and Discussion