aboutsummaryrefslogtreecommitdiffstats
path: root/lib/runtime_tools/doc/src/LTTng.xml
blob: eab1848e88a192b5955ea3052b8f789aade250c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<?xml version="1.0" encoding="utf8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
    <header>
        <copyright>
            <year>2016</year><year>2016</year>
            <holder>Ericsson AB. All Rights Reserved.</holder>
        </copyright>
        <legalnotice>
            Licensed under the Apache License, Version 2.0 (the "License");
            you may not use this file except in compliance with the License.
            You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

            Unless required by applicable law or agreed to in writing, software
            distributed under the License is distributed on an "AS IS" BASIS,
            WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
            See the License for the specific language governing permissions and
            limitations under the License.
        </legalnotice>

        <title>LTTng and Erlang/OTP</title>
        <prepared></prepared>
        <responsible></responsible>
        <docno></docno>
        <approved></approved>
        <checked></checked>
        <date>2016-04-27</date>
        <rev></rev>
        <file>LTTng.xml</file>
    </header>

    <section>
        <title>Introduction</title>
        <p>The Linux Trace Toolkit: next generation is an open source system software package
            for correlated tracing of the Linux kernel, user applications and libraries. </p>
        <p>For more information, please visit <url href="http://lttng.org">http://lttng.org</url></p>
    </section>

    <section>
        <title>Building Erlang/OTP with LTTng support</title>
        <p>
            Configure and build Erlang with LTTng support:
        </p>
        <p>For LTTng to work properly with Erlang/OTP you need
            the following packages installed:</p>

      <list type="bulleted">
          <item><p>LTTng-tools: a command line interface to control tracing sessions.</p></item>
          <item><p>LTTng-UST: user space tracing library.</p></item>
      </list>

      <p>On Ubuntu this can be installed via <c>aptitude</c>:</p>

      <code type="none">$ sudo aptitude install lttng-tools liblttng-ust-dev</code>
      <p>See <url href="http://lttng.org/docs/#doc-installing-lttng">Installing LTTng</url>
          for more information on how to install LTTng on your system.</p>

      <p>After LTTng is properly installed on the system Erlang/OTP can be built with LTTng support.</p>
 

<code type="none">$ ./configure --with-dynamic-trace=lttng
$ make </code>
    </section>

    <section>
        <title>Dyntrace Tracepoints</title>
        <p>All tracepoints are in the domain of <c>com_ericsson_dyntrace</c></p>
        <p>All Erlang types are the string equivalent in LTTng.</p>

        <p><em>process_spawn</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>parent : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>entry : string</c> :: Code Location. Ex. <c>"lists:sort/1"</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">process_spawn: { cpu_id = 3 }, { pid = "&lt;0.131.0&gt;", parent = "&lt;0.130.0&gt;", entry = "erlang:apply/2" }</code></p>

        <p><em>process_link</em></p>
        <list type="bulleted">
            <item><c>to : string</c> :: Process ID or Port ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>from : string</c> :: Process ID or Port ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>type : string</c> :: <c>"link" | "unlink"</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">process_link: { cpu_id = 3 }, { from = "&lt;0.130.0&gt;", to = "&lt;0.131.0&gt;", type = "link" }</code></p>


        <p><em>process_exit</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>reason : string</c> :: Exit reason. Ex. <c>"normal"</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">process_exit: { cpu_id = 3 }, { pid = "&lt;0.130.0&gt;", reason = "normal" }</code></p>

        <p><em>process_register</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>name : string</c> :: Registered name. Ex. <c>"error_logger"</c></item>
            <item><c>type : string</c> :: <c>"register" | "unregister"</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">process_register: { cpu_id = 0 }, { pid = "&lt;0.128.0&gt;", name = "dyntrace_lttng_SUITE" type = "register" }</code></p>

        <p><em>process_scheduled</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>entry : string</c> :: Code Location. Ex. <c>"lists:sort/1"</c></item>
            <item><c>type : string</c> :: <c>"in" | "out" | "in_exiting" | "out_exiting" | "out_exited"</c></item>
        </list>

        <p>Example:</p>
        <p><code type="none">process_scheduled: { cpu_id = 0 }, { pid = "&lt;0.136.0&gt;", entry = "erlang:apply/2", type = "in" }</code></p>


        <p><em>port_open</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
            <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
        </list>

        <p>Example:</p>
        <p><code type="none">port_open: { cpu_id = 5 }, { pid = "&lt;0.131.0&gt;", driver = "'/bin/sh -s unix:cmd'", port = "#Port&lt;0.1887&gt;" }</code></p>

        <p><em>port_exit</em></p>
        <list type="bulleted">
            <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
            <item><c>reason : string</c> :: Exit reason. Ex. <c>"normal"</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">port_exit: { cpu_id = 5 }, { port = "#Port&lt;0.1887&gt;", reason = "normal" }</code></p>

        <p><em>port_link</em></p>
        <list type="bulleted">
            <item><c>to : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>from : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>type : string</c> :: <c>"link" | "unlink"</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">port_link: { cpu_id = 5 }, { from = "#Port&lt;0.1887&gt;", to = "&lt;0.131.0&gt;", type = "unlink" }</code></p>

        <p><em>port_scheduled</em></p>
        <list type="bulleted">
            <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
            <item><c>entry : string</c> :: Callback. Ex. <c>"open"</c></item>
            <item><c>type : string</c> :: <c>"in" | "out" | "in_exiting" | "out_exiting" | "out_exited"</c></item>
        </list>

        <p>Example:</p>
        <p><code type="none">port_scheduled: { cpu_id = 5 }, { pid = "#Port&lt;0.1905&gt;", entry = "close", type = "out" }</code></p>

        <p><em>function_call</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>entry : string</c> :: Code Location. Ex. <c>"lists:sort/1"</c></item>
            <item><c>depth : integer</c> :: Stack depth. Ex. <c>0</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">function_call: { cpu_id = 5 }, { pid = "&lt;0.145.0&gt;", entry = "dyntrace_lttng_SUITE:'-t_call/1-fun-1-'/0", depth = 0 }</code></p>

        <p><em>function_return</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>entry : string</c> :: Code Location. Ex. <c>"lists:sort/1"</c></item>
            <item><c>depth : integer</c> :: Stack depth. Ex. <c>0</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">function_return: { cpu_id = 5 }, { pid = "&lt;0.145.0&gt;", entry = "dyntrace_lttng_SUITE:waiter/0", depth = 0 }</code></p>

        <p><em>function_exception</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>entry : string</c> :: Code Location. Ex. <c>"lists:sort/1"</c></item>
            <item><c>class : string</c> :: Error reason. Ex. <c>"error"</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">function_exception: { cpu_id = 5 }, { pid = "&lt;0.144.0&gt;", entry = "t:call_exc/1", class = "error" }</code></p>

        <p><em>message_send</em></p>
        <list type="bulleted">
            <item><c>from : string</c> :: Process ID or Port ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>to : string</c> :: Process ID or Port ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>message : string</c> :: Message sent. Ex. <c>"{&lt;0.162.0&gt;,ok}"</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">message_send: { cpu_id = 3 }, { from = "#Port&lt;0.1938&gt;", to = "&lt;0.160.0&gt;", message = "{#Port&lt;0.1938&gt;,eof}" }</code></p>

        <p><em>message_receive</em></p>
        <list type="bulleted">
            <item><c>to : string</c> :: Process ID or Port ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>message : string</c> :: Message received. Ex. <c>"{&lt;0.162.0&gt;,ok}"</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">message_receive: { cpu_id = 7 }, { to = "&lt;0.167.0&gt;", message = "{&lt;0.165.0&gt;,ok}" }</code></p>

        <p><em>gc_minor_start</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>need : integer</c> :: Heap need. Ex. <c>2</c></item>
            <item><c>heap : integer</c> :: Young heap word size. Ex. <c>233</c></item>
            <item><c>old_heap : integer</c> :: Old heap word size. Ex. <c>233</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">gc_minor_start: { cpu_id = 0 }, { pid = "&lt;0.172.0&gt;", need = 0, heap = 610, old_heap = 0 }</code></p>

        <p><em>gc_minor_end</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>reclaimed : integer</c> :: Heap reclaimed. Ex. <c>2</c></item>
            <item><c>heap : integer</c> :: Young heap word size. Ex. <c>233</c></item>
            <item><c>old_heap : integer</c> :: Old heap word size. Ex. <c>233</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">gc_minor_end: { cpu_id = 0 }, { pid = "&lt;0.172.0&gt;", reclaimed = 120, heap = 1598, old_heap = 1598 }</code></p>

        <p><em>gc_major_start</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>need : integer</c> :: Heap need. Ex. <c>2</c></item>
            <item><c>heap : integer</c> :: Young heap word size. Ex. <c>233</c></item>
            <item><c>old_heap : integer</c> :: Old heap word size. Ex. <c>233</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">gc_major_start: { cpu_id = 0 }, { pid = "&lt;0.172.0&gt;", need = 8, heap = 2586, old_heap = 1598 }</code></p>

        <p><em>gc_major_end</em></p>
        <list type="bulleted">
            <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
            <item><c>reclaimed : integer</c> :: Heap reclaimed. Ex. <c>2</c></item>
            <item><c>heap : integer</c> :: Young heap word size. Ex. <c>233</c></item>
            <item><c>old_heap : integer</c> :: Old heap word size. Ex. <c>233</c></item>
        </list>
        <p>Example:</p>
        <p><code type="none">gc_major_end: { cpu_id = 0 }, { pid = "&lt;0.172.0&gt;", reclaimed = 240, heap = 4185, old_heap = 0 }</code></p>

    </section>

    <section>
        <title>Examples</title>
    </section>
</chapter>