<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../../../../doc/otp_doc.css" type="text/css"> <title>Erlang -- Erlang Top</title> </head> <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container"> <script id="js" type="text/javascript" language="JavaScript" src="../../../../doc/js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../../../../doc/js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript"> <!-- function getWinHeight() { var myHeight = 0; if( typeof( window.innerHeight ) == 'number' ) { //Non-IE myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myHeight = document.body.clientHeight; } return myHeight; } function setscrollpos() { var objf=document.getElementById('loadscrollpos'); document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2; } function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } addEvent(window, 'load', setscrollpos); //--></script><div id="leftnav"><div class="innertube"> <img alt="Erlang logo" src="../../../../doc/erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="index.html">Reference Manual</a><br><a href="release_notes.html">Release Notes</a><br><a href="../pdf/observer-1.2.pdf">PDF</a><br><a href="../../../../doc/index.html">Top</a></small><p><strong>Observer</strong><br><strong>User's Guide</strong><br><small>Version 1.2</small></p> <br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Chapters</strong></small></p> <ul class="flipMenu" imagepath="../../../../doc/js/flipmenu"> <li id="no" title="Observer" expanded="false">Observer<ul> <li><a href="observer_ug.html"> Top of chapter </a></li> <li title="Introduction"><a href="observer_ug.html#id61965">Introduction</a></li> <li title="General"><a href="observer_ug.html#id63021">General</a></li> <li title="Applications"><a href="observer_ug.html#id61978">Applications</a></li> <li title="Processes"><a href="observer_ug.html#id58232">Processes</a></li> <li title="Table Viewer"><a href="observer_ug.html#id61813">Table Viewer</a></li> <li title="Trace Overview"><a href="observer_ug.html#id58317">Trace Overview</a></li> </ul> </li> <li id="no" title="Trace Tool Builder" expanded="false">Trace Tool Builder<ul> <li><a href="ttb_ug.html"> Top of chapter </a></li> <li title="Introduction"><a href="ttb_ug.html#id62654">Introduction</a></li> <li title="Getting Started"><a href="ttb_ug.html#id62682">Getting Started</a></li> <li title="Running the Trace Tool Builder against a remote node"><a href="ttb_ug.html#id62166">Running the Trace Tool Builder against a remote node</a></li> <li title="Additional tracing options"><a href="ttb_ug.html#id59987">Additional tracing options</a></li> <li title="Trace Information and the .ti File"><a href="ttb_ug.html#id62926">Trace Information and the .ti File</a></li> <li title="Wrap Logs"><a href="ttb_ug.html#id61480">Wrap Logs</a></li> <li title="Formatting"><a href="ttb_ug.html#id61519">Formatting</a></li> <li title="Automatically collect and format logs from all nodes"><a href="ttb_ug.html#id62581">Automatically collect and format logs from all nodes</a></li> <li title="History and Configuration Files"><a href="ttb_ug.html#id63031">History and Configuration Files</a></li> <li title="Sequential Tracing"><a href="ttb_ug.html#id63279">Sequential Tracing</a></li> <li title="Example: Multipurpose trace tool"><a href="ttb_ug.html#id63411">Example: Multipurpose trace tool</a></li> </ul> </li> <li id="loadscrollpos" title="Erlang Top" expanded="true">Erlang Top<ul> <li><a href="etop_ug.html"> Top of chapter </a></li> <li title="Introduction"><a href="etop_ug.html#id64602">Introduction</a></li> <li title="Output"><a href="etop_ug.html#id64621">Output</a></li> <li title="Start"><a href="etop_ug.html#id64768">Start</a></li> <li title="Configuration"><a href="etop_ug.html#id64805">Configuration</a></li> <li title="Print to file"><a href="etop_ug.html#id64958">Print to file</a></li> <li title="Stop"><a href="etop_ug.html#id64985">Stop</a></li> </ul> </li> <li id="no" title="Crashdump Viewer" expanded="false">Crashdump Viewer<ul> <li><a href="crashdump_ug.html"> Top of chapter </a></li> <li title="Introduction"><a href="crashdump_ug.html#id65063">Introduction</a></li> <li title="Getting Started"><a href="crashdump_ug.html#id65075">Getting Started</a></li> <li title="Navigating"><a href="crashdump_ug.html#id65156">Navigating</a></li> <li title="Help"><a href="crashdump_ug.html#id65186">Help</a></li> </ul> </li> </ul> </div></div> <div id="content"> <div class="innertube"> <h1>3 Erlang Top</h1> <h3><a name="id64602">3.1 Introduction</a></h3> <p>Erlang Top, <span class="code">etop</span> is a tool for presenting information about erlang processes similar to the information presented by <span class="code">top</span> in UNIX. </p> <h3><a name="id64621">3.2 Output</a></h3> <p>The output from <span class="code">etop</span> can be graphical or text based. </p> <p>Text based it looks like this:</p> <div class="example"><pre> ======================================================================================== tiger@durin 13:40:32 Load: cpu 0 Memory: total 1997 binary 33 procs 197 processes 0 code 173 runq 135 atom 1002 ets 95 Pid Name or Initial Func Time Reds Memory MsgQ Current Function ---------------------------------------------------------------------------------------- <127.23.0> code_server 0 59585 78064 0 gen_server:loop/6 <127.21.0> file_server_2 0 36380 44276 0 gen_server:loop/6 <127.2.0> erl_prim_loader 0 27962 3740 0 erl_prim_loader:loop <127.9.0> kernel_sup 0 6998 4676 0 gen_server:loop/6 <127.17.0> net_kernel 62 6018 3136 0 gen_server:loop/6 <127.0.0> init 0 4156 4352 0 init:loop/1 <127.16.0> auth 0 1765 1264 0 gen_server:loop/6 <127.18.0> inet_tcp_dist:accept 0 660 1416 0 prim_inet:accept0/2 <127.5.0> application_controll 0 569 6756 0 gen_server:loop/6 <127.137.0> net_kernel:do_spawn_ 0 553 5840 0 dbg:do_relay_1/1 ======================================================================================== </pre></div> <p>And graphically it looks like this:</p> <img alt="IMAGE MISSING" src="etop_main.gif"><br> <em>Figure 3.1: Graphical presentation of etop</em> <p>The header includes some system information: </p> <dl> <dt><strong>Load</strong></dt> <dd> <span class="code">cpu</span> is <span class="code">Runtime/Wallclock</span>, i.e. the percentage of time where the node has been active, <span class="code">procs</span> is the number of processes on the node, and <span class="code">runq</span> is the number of processes that are ready to run.</dd> <dt><strong>Memory</strong></dt> <dd>This is the memory allocated by the node in kilo bytes.</dd> </dl> <p>For each process the following information is presented: </p> <dl> <dt><strong>Time</strong></dt> <dd>This is the runtime for the process, i.e. the actual time the process has been scheduled in.</dd> <dt><strong>Reds</strong></dt> <dd>This is the number of reductions that has been executed on the process</dd> <dt><strong>Memory</strong></dt> <dd>This is the size of the process in bytes, obtained by a call to <span class="code">process_info(Pid,memory)</span>.</dd> <dt><strong>MsgQ</strong></dt> <dd>This is the length of the message queue for the process.</dd> </dl> <div class="note"> <div class="label">Note</div> <div class="content"><p> <p><strong>Time</strong> and <strong>Reds</strong> can be presented as accumulated values or as values since last update.</p> </p></div> </div> <h3><a name="id64768">3.3 Start</a></h3> <p>To start etop with the graphical presentation, use the script <span class="code">getop</span> or the batch file <span class="code">getop.bat</span>, e.g. <span class="code">getop -node tiger@durin</span></p> <p>To start etop with the text based presentation use the script <span class="code">etop</span> or the batch file <span class="code">etop.bat</span>, e.g. <span class="code">etop -node tiger@durin</span>, </p> <h3><a name="id64805">3.4 Configuration</a></h3> <p>All configuration parameters can be set at start by adding <span class="code">-OptName Value</span> to the command line, e.g. <span class="code">etop -node tiger@durin -setcookie mycookie -lines 15</span>. </p> <p>The parameters <span class="code">lines</span>, <span class="code">interval</span>, <span class="code">accumulate</span> and <span class="code">sort</span> can be changed during runtime. Use the <strong>Options</strong> menu with the graphical presentation or the function <span class="code">etop:config/2</span> with the text based presentation. </p> <p>A list of all valid configuration parameters can be found in the reference manual for <span class="code">etop</span>. </p> <p>Note that it is even possible to change which information to sort by by clicking the header line of the table in the graphical presentation. </p> <h4>Example: Change configuration with graphical presentation</h4> <img alt="IMAGE MISSING" src="etop_opt.gif"><br> <em>Figure 3.2: Select the option to change from the Options menu.</em> <img alt="IMAGE MISSING" src="etop_lines.gif"><br> <em>Figure 3.3: Enter the new value in the popup window and click "Ok"</em> <img alt="IMAGE MISSING" src="etop_5.gif"><br> <em>Figure 3.4: The interface is updated with the new configuration</em> <h4>Example: Change configuration with text based presentation</h4> <div class="example"><pre> ======================================================================================== tiger@durin 10:12:39 Load: cpu 0 Memory: total 1858 binary 33 procs 191 processes 0 code 173 runq 2 atom 1002 ets 95 Pid Name or Initial Func Time Reds Memory MsgQ Current Function ---------------------------------------------------------------------------------------- <127.23.0> code_server 0 60350 71176 0 gen_server:loop/6 <127.21.0> file_server_2 0 36380 44276 0 gen_server:loop/6 <127.2.0> erl_prim_loader 0 27962 3740 0 erl_prim_loader:loop <127.17.0> net_kernel 0 13808 3916 0 gen_server:loop/6 <127.9.0> kernel_sup 0 6998 4676 0 gen_server:loop/6 <127.0.0> init 0 4156 4352 0 init:loop/1 <127.18.0> inet_tcp_dist:accept 0 2196 1416 0 prim_inet:accept0/2 <127.16.0> auth 0 1893 1264 0 gen_server:loop/6 <127.43.0> ddll_server 0 582 3744 0 gen_server:loop/6 <127.5.0> application_controll 0 569 6756 0 gen_server:loop/6 ======================================================================================== </pre></div> <p><strong><span class="code">etop:config(lines,5).</span></strong> <br> <strong><span class="code">ok</span></strong></p> <div class="example"><pre> (etop@durin)2> ======================================================================================== tiger@durin 10:12:44 Load: cpu 0 Memory: total 1859 binary 33 procs 192 processes 0 code 173 runq 2 atom 1002 ets 95 Pid Name or Initial Func Time Reds Memory MsgQ Current Function ---------------------------------------------------------------------------------------- <127.17.0> net_kernel 183 70 4092 0 gen_server:loop/6 <127.335.0> inet_tcp_dist:do_acc 141 22 1856 0 dist_util:con_loop/9 <127.19.0> net_kernel:ticker/2 155 6 1244 0 net_kernel:ticker1/2 <127.341.0> net_kernel:do_spawn_ 0 0 5840 0 dbg:do_relay_1/1 <127.43.0> ddll_server 0 0 3744 0 gen_server:loop/6 ======================================================================================== </pre></div> <h3><a name="id64958">3.5 Print to file</a></h3> <p>At any time, the current <span class="code">etop</span> display can be dumped to a text file. Use <strong>Dump to file</strong> on the <strong>File</strong> menu with the graphical presentation or the function <span class="code">etop:dump/1</span> with the text based presentation. </p> <h3><a name="id64985">3.6 Stop</a></h3> <p>To stop <span class="code">etop</span>, use <strong>Exit</strong> on the <strong>File</strong> menu for the graphical presentation, or the function <span class="code">etop:stop/0</span> with the text based presentation. </p> </div> <div class="footer"> <hr> <p>Copyright © 2002-2012 Ericsson AB. All Rights Reserved.</p> </div> </div> </div></body> </html>