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:
Manual usage
Put the following dependency into your project's dependences section:
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
- 0.0.1 released 4 years ago
- drug007/usdt
- BSL
- Copyright © 2019-2020, drug007
- Authors:
- Dependencies:
- none
- Versions:
-
0.0.1 2020-Feb-25 ~master 2020-Feb-26 ~other 2020-Feb-25 ~develop 2020-Feb-26 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
67 downloads total
-
- Score:
- 0.8
- Short URL:
- usdt.dub.pm