Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 73 lines (48 sloc) 2.204 kB
0331c29 @slfritchie Add DTrace support for OS X, Solaris, and Linux (via SystemTap), 2/4
slfritchie authored
1 SystemTap and Erlang/OTP
2 ========================
3
4 Introduction
5 ------------
6
7 SystemTap is DTrace for Linux. In fact Erlang's SystemTap support
8 is build using SystemTap's DTrace compatibility's layer. For an
9 introduction to Erlang DTrace support read README.dtrace.md.
10
11 Requisites
12 ----------
13
14 * Linux Kernel with UTRACE support
15
16 check for UTRACE support in your current kernel:
17
18 # grep CONFIG_UTRACE /boot/config-`uname -r`
19 CONFIG_UTRACE=y
20
21 Fedora 16 is known to contain UTRACE, for most other Linux distributions
22 a custom build kernel will be required.
23 Check Fedora's SystemTap documentation for additional required packages
24 (e.g. Kernel Debug Symbols)
25
26 * SystemTap > 1.6
27
28 A the time of writing this, the latest released version of SystemTap is
29 version 1.6. Erlang's DTrace support requires a MACRO that was introduced
30 after that release. So either get a newer release or build SystemTap from
31 git yourself (see: http://sourceware.org/systemtap/getinvolved.html)
32
33 Building Erlang
34 ---------------
35
36 Configure and build Erlang with SystemTap support:
37
0c0d640 @bufflig Update README's for dtrace and systemtap
bufflig authored
38 # ./configure --with-dynamic-trace=systemtap + whatever args you need
0331c29 @slfritchie Add DTrace support for OS X, Solaris, and Linux (via SystemTap), 2/4
slfritchie authored
39 # make
40
41 Testing
42 -------
43
44 SystemTap, unlike DTrace, needs to know what binary it is tracing and has to
45 be able to read that binary before it starts tracing. Your probe script
46 therefor has to reference the correct beam emulator and stap needs to be able
47 to find that binary.
48 The examples are written for "beam", but other versions such as "beam.smp" or
49 "beam.debug.smp" might exist (depending on your configuration). Make sure you
50 either specify the full the path of the binary in the probe or your "beam"
51 binary is in the search path.
52
53 All available probes can be listed like this:
54
55 # stap -L 'process("beam").mark("*")'
56
57 or:
58
59 # PATH=/path/to/beam:$PATH stap -L 'process("beam").mark("*")'
60
61
62 Probes in the dtrace.so NIF library like this:
63
64 # PATH=/path/to/dtrace/priv/lib:$PATH stap -L 'process("dtrace.so").mark("*")'
65
66 Running SystemTap scripts
67 -------------------------
68
69 Adjust the process("beam") reference to your beam version and attach the script
70 to a running "beam" instance:
71
72 # stap /path/to/probe/script/port1.systemtap -x <pid of beam>
Something went wrong with that request. Please try again.