aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/doc/src/observer_ug.xml
blob: ca354df8641f93227836b569abb2d4ea385ab44f (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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<chapter>
  <header>
    <copyright>
      <year>2011</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>Observer</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>
    <file>observer_ug.xml</file>
  </header>

  <section>
    <title>Introduction</title>
    <p>Observer is a graphical tool for observing the characteristics of
    Erlang systems. Observer displays system information, application
    supervisor trees, process information, ETS tables, Mnesia tables
    and contains a front end for Erlang tracing.
    </p>
  </section>

  <section>
    <title>Getting Started</title>
    <p>Run Observer from a standalone node to minimize the impact of the 
    system being observed.
    </p>
    <p><em>Example:</em></p>
    <pre>
% <input>erl -sname observer -hidden -setcookie MyCookie -run observer</input></pre>
    <p>
      Select the node to observe with menu <em>Nodes</em>. 
      Menu <em>View &gt; Refresh interval</em> controls how often 
      the view is to be updated.
      The refresh interval is set per viewer so you can
      have different settings for each viewer. To minimize the system
      impact, only the active viewer is updated. Other views are updated 
      when activated.
    </p>

    <p>The mouse buttons behave as expected. Use left-click
    to select objects, right-click to get a menu with the most used
    options, and double-click to display information about the
    selected object. In most viewers with many columns, you can change
    the sort order by left-clicking the column header.
    </p>
  </section>

  <section>
    <title>System Tab</title>
    <p>Tab <em>System</em> displays general information about the active Erlang node 
    and its runtime system, such as build configuration, system capabilities, and 
    overall use statistics.
</p>
  </section>

  <section>
    <title>Load Charts Tab</title>
    <p>Tab <em>Load Charts</em> displays graphs of the current resource use on 
    the active Erlang node.</p>
    <p>Graph <c>Scheduler Utilization</c> shows scheduler use per scheduler, 
    where each scheduler use has a unique color.</p>
    <p>Graph <c>Memory Usage</c> shows the total memory use and per memory category
    use, where each category has a unique color. The categories are as 
    follows:</p>
    <taglist>
       <tag><c>Total</c></tag>
       <item><p>The sum of all memory categories.</p></item>
       <tag><c>Processes</c></tag>
       <item><p>The sum of all process memory used.</p></item>
       <tag><c>Atom</c></tag>
       <item><p>The size used by the atom table.</p></item>
       <tag><c>Binary</c></tag>
       <item><p>The sum of all off-heap binaries allocated.</p></item>
       <tag><c>Code</c></tag>
       <item><p>The memory allocated for code storage.</p></item>
       <tag><c>Ets</c></tag>
       <item><p>The used memory for all ETS tables.</p></item>
     </taglist>

    <p>Graph <c>IO Usage</c> shows the current I/O load on the system.</p>
  </section>

  <section>
    <title>Memory Allocators Tab</title>
    <p>Tab <em>Memory Allocators</em> displays detailed information of the carrier 
    size and current memory carriers. For details about memory carriers, 
    see module
    <seealso marker="erts:erts_alloc"><c>erts_alloc</c></seealso>
    in application ERTS.</p>
  </section>

  <section>
    <title>Applications Tab</title>
    <p>Tab <em>Applications</em> presents application information.
    Select an application in the left list to display its supervisor
    tree. The right-click options in the tree are as follows:
    </p>
    <taglist>
    <tag>Process info</tag>
    <item><p>Opens a detailed information window on the selected process,
    including the following:</p>
    <taglist>
      <tag>Process Information</tag>
      <item><p>Shows the process information.</p></item>
      <tag>Messages</tag>
      <item><p>Shows the process messages.</p></item>
      <tag>Dictionary</tag>
      <item><p>Shows the process dictionary.</p></item>
      <tag>Stack Trace</tag>
      <item><p>Shows the process current stack trace.</p></item>
      <tag>State</tag>
      <item><p>Shows the process state.</p></item>
      <tag>Log</tag>
      <item><p>If enabled and available, shows the process SASL
      log entries.</p></item>
    </taglist>
    </item>
    <tag>Trace process</tag>
    <item><p>Adds the selected process identifier to tab <em>Trace Overview</em> 
    plus the node that the process resides on.</p></item>
    <tag>Trace named process</tag>
    <item><p>Adds the registered name of the process. This can be useful when tracing on
    many nodes, as processes with that name are then traced on all traced nodes.</p></item>
    <tag>Trace process tree</tag>
    <item><p>Adds the selected process and all processes below,
    right of it, to tab <em>Trace Overview</em>.</p></item>
    <tag>Trace named process tree</tag>
    <item><p>Adds the selected process and all processes below,
    right of it, to tab <em>Trace Overview</em>.</p></item>
    </taglist>
  </section>

  <section>
    <title>Processes Tab</title>
    <p>Tab <em>Processes</em> lists process information in columns.
    For each process the following information is displayed:
    </p>
    <taglist>
      <tag>Pid</tag>
      <item><p>The process identifier.</p></item>
      <tag>Reds</tag>
      <item><p>The number of reductions executed on the process. 
      This can be presented as accumulated values or as values since the last update.</p></item>
      <tag>Memory</tag>
      <item><p>The size of the process, in bytes, obtained by a
       call to <c>process_info(Pid,memory)</c>.</p></item>
      <tag>MsgQ</tag>
      <item><p>The length of the message queue for the process.</p></item>
    </taglist>

    <p>Option <em>Process info</em> opens a detailed information window on the selected process, 
      including the following:</p>
    <taglist>
      <tag>Process Information</tag>
      <item><p>Shows the process information.</p></item>
      <tag>Messages</tag>
      <item><p>Shows the process messages.</p></item>
      <tag>Dictionary</tag>
      <item><p>Shows the process dictionary.</p></item>
      <tag>Stack Trace</tag>
      <item><p>Shows the process current stack trace.</p></item>
      <tag>State</tag>
      <item><p>Shows the process state.</p></item>
      <tag>Log</tag>
      <item><p>If enabled and available, shows the process SASL log entries.</p></item>
    </taglist>
    
    <note>
      <p><em>Log</em> requires application SASL  to be started on the observed node,
      with <c>log_mf_h</c> as log handler.
      The Observed node must be Erlang/OTP R16B02 or higher.
      The <c>rb</c> server must not be started on the observed node when clicking menu 
      <em>Log &gt; Toggle log view</em>. The <c>rb</c> server is stopped on the observed node 
      when exiting or changing the observed node.
      </p>
    </note>

    <p>Option <em>Trace Processes</em> adds the selected process identifiers to tab 
    <em>Trace Overview</em> plus the node that the processes reside on.
    </p>
    <p>Option <em>Trace Named Processes</em> adds the registered name of the processes. This can be 
    useful when tracing is done on many nodes, as processes with that name are then traced on 
    all traced nodes.</p>

  </section>

  <section>
    <title>Table Viewer Tab</title>
    <p>Tab <em>Table Viewer</em> lists tables. By default, ETS tables
    are displayed whereas unreadable private ETS tables and tables created by OTP
    applications are not diplayed. Use menu <em>View</em> to view "system"
    ETS tables, unreadable ETS tables, or Mnesia tables.
    </p>
    <p>Double-click to view the table content. To view table information, select the table 
    and activate menu <em>View &gt; Table information</em>.</p>
    <p>You can use <seealso marker="stdlib:re">regular
    expressions</seealso> and search for objects, and edit or delete them.
    </p>
  </section>

  <section>
    <title>Trace Overview Tab</title>
    <p>Tab <em>Trace Overview</em> handles tracing. Trace
    by selecting the processes to be traced and how to trace
    them. You can trace messages, function calls, and events, where
    events are process-related events such as <c>spawn</c>,
    <c>exit</c>, and many others.
    </p>

    <p>To trace function calls, you also need to set up
    <em>trace patterns</em>. Trace patterns select the function calls
    to be traced. The number of traced function calls can be
    further reduced with <em>match specifications</em>. Match
    specifications can also be used to trigger more information
    in the trace messages.
    </p>
    <note><p>Trace patterns only apply to the traced processes.</p></note>

    <p>
      Processes are added from the <em>Applications</em> or <em>Processes</em> tabs.
      A special <em>new</em> identifier, meaning all processes spawned after trace 
      start, can be added with button <em>Add 'new' Process</em>.
    </p>
    <p>
      When adding processes, a window with trace options is displayed. The chosen 
      options are set for the selected processes.
      Process options can be changed by right-clicking a process.
    </p>
    <p>
      Processes added by process identifiers add the nodes these
      processes reside on in the node list. More nodes can be added by clicking 
      button <em>Add Nodes</em>.
    </p>
    <p>
      If function calls are traced, trace patterns must be added by clicking button
      <em>Add Trace Pattern</em>. Select a module, function(s), and a match specification.
      If no functions are selected, all functions in the module are traced.
      A few basic match specifications are provided in the tool, and
      you can provide your own match specifications. The syntax of match
      specifications is described in the <seealso
      marker="erts:match_spec"><c>ERTS User's Guide</c></seealso>. To simplify
      the writing of a match specification, they can also be written as
      <c>fun/1</c>. For details, see module
      <seealso marker="stdlib:ms_transform">ms_transform</seealso>
      in application STDLIB.
    </p>

    <p>Click button <em>Start Trace</em> to start the trace.
    By default, trace output is written to a new window. Tracing is stopped 
    when the window is closed, or when clicking button <em>Stop Trace</em>.
    Trace output can be changed with menu <em>Options > Output</em>.
    The trace settings, including match specifications, can be saved to, 
    or loaded from, a file.
    </p>
    <p>For details about tracing, see module <seealso
    marker="runtime_tools:dbg">dbg</seealso> in application Runtime_Tools
    and in section "Match specifications in Erlang" in 
    <seealso marker="erts:match_spec"><c>ERTS User's Guide</c></seealso>
    and in module
    <seealso marker="stdlib:ms_transform"><c>ms_transform</c></seealso>
    in application STDLIB.
    </p>
  </section>
</chapter>