From 0331c29e0e494d4c1e4fdd05e48a3f88a8caea0b Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Thu, 17 Nov 2011 00:44:30 -0600 Subject: Add DTrace support for OS X, Solaris, and Linux (via SystemTap), 2/4 Add D scripts in the `lib/dtrace/examples` directory. Add SystemTap README and sample scripts, contributed by Andreas Schultz . --- README.systemtap.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 README.systemtap.md (limited to 'README.systemtap.md') diff --git a/README.systemtap.md b/README.systemtap.md new file mode 100644 index 0000000000..3bb3e626cd --- /dev/null +++ b/README.systemtap.md @@ -0,0 +1,72 @@ +SystemTap and Erlang/OTP +======================== + +Introduction +------------ + +SystemTap is DTrace for Linux. In fact Erlang's SystemTap support +is build using SystemTap's DTrace compatibility's layer. For an +introduction to Erlang DTrace support read README.dtrace.md. + +Requisites +---------- + +* Linux Kernel with UTRACE support + + check for UTRACE support in your current kernel: + + # grep CONFIG_UTRACE /boot/config-`uname -r` + CONFIG_UTRACE=y + + Fedora 16 is known to contain UTRACE, for most other Linux distributions + a custom build kernel will be required. + Check Fedora's SystemTap documentation for additional required packages + (e.g. Kernel Debug Symbols) + +* SystemTap > 1.6 + + A the time of writing this, the latest released version of SystemTap is + version 1.6. Erlang's DTrace support requires a MACRO that was introduced + after that release. So either get a newer release or build SystemTap from + git yourself (see: http://sourceware.org/systemtap/getinvolved.html) + +Building Erlang +--------------- + +Configure and build Erlang with SystemTap support: + + # ./configure --enable-dtrace + whatever args you need + # make + +Testing +------- + +SystemTap, unlike DTrace, needs to know what binary it is tracing and has to +be able to read that binary before it starts tracing. Your probe script +therefor has to reference the correct beam emulator and stap needs to be able +to find that binary. +The examples are written for "beam", but other versions such as "beam.smp" or +"beam.debug.smp" might exist (depending on your configuration). Make sure you +either specify the full the path of the binary in the probe or your "beam" +binary is in the search path. + +All available probes can be listed like this: + + # stap -L 'process("beam").mark("*")' + +or: + + # PATH=/path/to/beam:$PATH stap -L 'process("beam").mark("*")' + + +Probes in the dtrace.so NIF library like this: + + # PATH=/path/to/dtrace/priv/lib:$PATH stap -L 'process("dtrace.so").mark("*")' + +Running SystemTap scripts +------------------------- + +Adjust the process("beam") reference to your beam version and attach the script +to a running "beam" instance: + + # stap /path/to/probe/script/port1.systemtap -x -- cgit v1.2.3 From 0c0d640ed423d4a386de75a2b37a1be038c2d059 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Wed, 21 Mar 2012 15:00:00 +0100 Subject: Update README's for dtrace and systemtap --- README.systemtap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.systemtap.md') diff --git a/README.systemtap.md b/README.systemtap.md index 3bb3e626cd..c190bcc893 100644 --- a/README.systemtap.md +++ b/README.systemtap.md @@ -35,7 +35,7 @@ Building Erlang Configure and build Erlang with SystemTap support: - # ./configure --enable-dtrace + whatever args you need + # ./configure --with-dynamic-trace=systemtap + whatever args you need # make Testing -- cgit v1.2.3