usdt 0.0.1

Userland Statically Defined Tracing probes support in the D programming language.


To use this package, run the following command in your project's root directory:

Userland Statically Defined Tracing

USDT is a mechanism for user land applications to embed their own probes into executables. The goal is near zero overhead when not invoked.

The steps involved in a USDT probe are as follows:

  • Add probe calls, via STAP_PROBE mixin to the source code of the application, probe call is a NOP instruction
  • Compile code using either gdc or ldc compiler, dmd does not support USDT probes currently
  • Whilst the application is running, you can use external tools to monitor these probes at any granularity you like (eg all probes from the process, or specific probes from all such processes).
  • When you monitors the probe, the site where the NOP instruction is placed is modified and an INT3 (breakpoint instruction) is placed at the site of the original NOP instruction. When the breakpoint is hit, kernel takes control and actions the probe. You can use different tools to define actions.

Note: ldc by default enables option "-linker-strip-dead" that eliminates usdt specific section as dead one. Use "-disable-linker-strip-dead" option to prevent this, see dub.sdl

Possible frontends to access the linux kernel tracing subsystem are:

Brendan Gregg's blog is one of very useful source of important information, in this post he writes about USDT and ftrace.

Usage example:

mixin(STAP_PROBE!("ProviderName", "ProbeName", args...));

where ProviderName and ProbeName describe the probe, args count should be equal or less than 12.

Known issues

Semaphores currently are not supported

Authors:
  • drug007
Dependencies:
none
Versions:
0.0.1 2020-Feb-25
~master 2020-Feb-26
~other 2020-Feb-25
~develop 2020-Feb-26
Show all 4 versions
Download Stats:
  • 1 downloads today

  • 1 downloads this week

  • 2 downloads this month

  • 4 downloads total

Score:
0.7
Short URL:
usdt.dub.pm