Erlang -- Observer

User's Guide
Reference Manual
Release Notes
PDF
Top

Observer
User's Guide
Version 1.2

Expand All
Contract All

Chapters

- Observer
  - Top of chapter
  - Introduction
  - General
  - Applications
  - Processes
  - Table Viewer
  - Trace Overview
- Trace Tool Builder
  - Top of chapter
  - Introduction
  - Getting Started
  - Running the Trace Tool Builder against a remote node
  - Additional tracing options
  - Trace Information and the .ti File
  - Wrap Logs
  - Formatting
  - Automatically collect and format logs from all nodes
  - History and Configuration Files
  - Sequential Tracing
  - Example: Multipurpose trace tool
- Erlang Top
  - Top of chapter
  - Introduction
  - Output
  - Start
  - Configuration
  - Print to file
  - Stop
- Crashdump Viewer
  - Top of chapter
  - Introduction
  - Getting Started
  - Navigating
  - Help

# 1 Observer

### 1.1 Introduction

Observer, is a graphical tool for observing the characteristics of erlang systems. Observer displays system information, application supervisor trees, process information, ets or mnesia tables and contains a frontend for erlang tracing.

### 1.2 General

Normally observer should be run from a standalone node to minimize the impact of the system being observed. Example:

     > erl -sname observer -hidden -setcookie MyCookie -run observer

Choose which node to observe via Nodes menu. The View/Refresh Interval controls how frequent the view should 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 and the other views will be updated when activated.

Note

Only R15B nodes can be observed.

In general the mouse buttons behaves as expected, use left click to select objects, right click to pop up a menu with most used choices and double click to bring up information about the selected object. In most viewers with several columns you can change sort order by left clicking on column header.

### 1.3 Applications

The Applications view lists application information. Select an application in the left list to display its supervisor tree.

Trace process will add the selected process identifier to Trace Overview view and the node the process resides on will be added as well.

Trace named process will add the registered name of the process. This can be useful when tracing on several nodes, then processes with that name will be traced on all traced nodes.

Trace process tree and Trace named process tree will add the selected process and all processes below, right of, it to the Trace Overview view.

### 1.4 Processes

The Processes view lists process information. For each process the following information is presented:

Pid
  The process identifier.
Reds
  This is the number of reductions that has been executed on the process
Memory
  This is the size of the process in bytes, obtained by a call to process_info(Pid,memory).
MsgQ
  This is the length of the message queue for the process.

Note

Reds can be presented as accumulated values or as values since last update.

Trace Processes will add the selected process identifiers to the Trace Overview view and the node the processes reside on will be added as well. Trace Named Processes will add the registered name of processes. This can be useful when tracing is done on several nodes, then processes with that name will be traced on all traced nodes.

### 1.5 Table Viewer

The Table Viewer view lists tables. By default ets tables are visible and unreadable, private ets, tables and tables created by the OTP applications are not visible. Use View menu to view "system" ets tables, unreadable ets tables or mnesia tables.

Double click to view the content of the table. Select table and activate View/Table Information menu to view table information.

In the table viewer you can regexp search for objects, edit and delete objects.

### 1.6 Trace Overview

The Trace Overview view handles tracing. Tracing is done by selecting which 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 spawn, exit and several others.

When you want to trace function calls, you also need to setup trace patterns. Trace patterns selects the function calls that will be traced. The number of traced function calls can be further reduced with match specifications. Match specifications can also be used to trigger additional information in the trace messages.

Note

Trace patterns only applies to the traced processes.

Processes are added from the Applications or Processes views. A special new identifier, meaning all processes spawned after trace start, can be added with the Add 'new' Process button.

When adding processes, a window with trace options will pop up. The chosen options will be set for the selected processes. Process options can be changed by right clicking on a process.

Processes added by process identifiers will add the nodes these processes resides on in the node list. Additional nodes can be added by the Add Nodes button.

If function calls are traced, trace patterns must be added by Add Trace Pattern button. Select a module, function(s) and a match specification. If no functions are selected, all functions in the module will be traced. A few basic match specifications are provided in the tool, and you can provide your own match specifications. The syntax of match specifications are described in the ERTS User's Guide. To simplify the writing of a match specification they can also be written as fun/1 see ms_transform manual page for further information.

Use the Start trace button to start the trace. By default trace output is written to a new window, tracing is stopped when the window is closed, or with Stop Trace button. Trace output can be changed via Options/Output menu. The trace settings, including match specifications, can be saved to, or loaded from, a file.

More information about tracing can be found in dbg and in the chapter "Match specifications in Erlang" in ERTS User's Guide and the ms_transform manual page.