Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > f806c0f24240b25bde21a53f71766070 > files > 1044

erlang-doc-R13B-04.6.fc13.noarch.rpm

<!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-0.9.8.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 0.9.8.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="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#id2252753">Introduction</a></li>
<li title="Getting Started"><a href="ttb_ug.html#id2252681">Getting Started</a></li>
<li title="Running the Trace Tool Builder against a remote node"><a href="ttb_ug.html#id2252820">Running the Trace Tool Builder against a remote node</a></li>
<li title="Trace Information and the .ti File"><a href="ttb_ug.html#id2252170">Trace Information and the .ti File</a></li>
<li title="Wrap Logs"><a href="ttb_ug.html#id2252996">Wrap Logs</a></li>
<li title="Formatting"><a href="ttb_ug.html#id2253032">Formatting</a></li>
<li title="Automatically collect and format logs from all nodes"><a href="ttb_ug.html#id2259108">Automatically collect and format logs from all nodes</a></li>
<li title="History and Configuration Files"><a href="ttb_ug.html#id2259162">History and Configuration Files</a></li>
<li title="Sequential Tracing"><a href="ttb_ug.html#id2251931">Sequential Tracing</a></li>
<li title="Example: Multipurpose trace tool"><a href="ttb_ug.html#id2252090">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#id2258632">Introduction</a></li>
<li title="Output"><a href="etop_ug.html#id2258652">Output</a></li>
<li title="Start"><a href="etop_ug.html#id2258820">Start</a></li>
<li title="Configuration"><a href="etop_ug.html#id2258859">Configuration</a></li>
<li title="Print to file"><a href="etop_ug.html#id2257168">Print to file</a></li>
<li title="Stop"><a href="etop_ug.html#id2257197">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#id2257281">Introduction</a></li>
<li title="Getting Started"><a href="crashdump_ug.html#id2257294">Getting Started</a></li>
<li title="Navigating"><a href="crashdump_ug.html#id2257366">Navigating</a></li>
<li title="Help"><a href="crashdump_ug.html#id2257404">Help</a></li>
</ul>
</li>
</ul>
</div></div>
<div id="content">
<div class="innertube">
<h1>2 Erlang Top</h1>
  

  <h3><a name="id2258632">2.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="id2258652">2.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
----------------------------------------------------------------------------------------
&lt;127.23.0&gt;     code_server                0   59585   78064       0 gen_server:loop/6   
&lt;127.21.0&gt;     file_server_2              0   36380   44276       0 gen_server:loop/6   
&lt;127.2.0&gt;      erl_prim_loader            0   27962    3740       0 erl_prim_loader:loop
&lt;127.9.0&gt;      kernel_sup                 0    6998    4676       0 gen_server:loop/6   
&lt;127.17.0&gt;     net_kernel                62    6018    3136       0 gen_server:loop/6   
&lt;127.0.0&gt;      init                       0    4156    4352       0 init:loop/1         
&lt;127.16.0&gt;     auth                       0    1765    1264       0 gen_server:loop/6   
&lt;127.18.0&gt;     inet_tcp_dist:accept       0     660    1416       0 prim_inet:accept0/2 
&lt;127.5.0&gt;      application_controll       0     569    6756       0 gen_server:loop/6   
&lt;127.137.0&gt;    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
        2.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="id2258820">2.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="id2258859">2.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
        2.2:
         
        Select the option to change from the Options menu.</em>
      
      <img alt="IMAGE MISSING" src="etop_lines.gif"><br>
        <em>Figure
        2.3:
         
        Enter the new value in the popup window and click "Ok"</em>
      
      <img alt="IMAGE MISSING" src="etop_5.gif"><br>
        <em>Figure
        2.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
----------------------------------------------------------------------------------------
&lt;127.23.0&gt;     code_server                0   60350   71176       0 gen_server:loop/6   
&lt;127.21.0&gt;     file_server_2              0   36380   44276       0 gen_server:loop/6   
&lt;127.2.0&gt;      erl_prim_loader            0   27962    3740       0 erl_prim_loader:loop
&lt;127.17.0&gt;     net_kernel                 0   13808    3916       0 gen_server:loop/6   
&lt;127.9.0&gt;      kernel_sup                 0    6998    4676       0 gen_server:loop/6   
&lt;127.0.0&gt;      init                       0    4156    4352       0 init:loop/1         
&lt;127.18.0&gt;     inet_tcp_dist:accept       0    2196    1416       0 prim_inet:accept0/2 
&lt;127.16.0&gt;     auth                       0    1893    1264       0 gen_server:loop/6   
&lt;127.43.0&gt;     ddll_server                0     582    3744       0 gen_server:loop/6   
&lt;127.5.0&gt;      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&gt; 
========================================================================================
 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
----------------------------------------------------------------------------------------
&lt;127.17.0&gt;     net_kernel               183      70    4092       0 gen_server:loop/6   
&lt;127.335.0&gt;    inet_tcp_dist:do_acc     141      22    1856       0 dist_util:con_loop/9
&lt;127.19.0&gt;     net_kernel:ticker/2      155       6    1244       0 net_kernel:ticker1/2
&lt;127.341.0&gt;    net_kernel:do_spawn_       0       0    5840       0 dbg:do_relay_1/1    
&lt;127.43.0&gt;     ddll_server                0       0    3744       0 gen_server:loop/6   
========================================================================================
      </pre></div>
    
  

  <h3><a name="id2257168">2.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="id2257197">2.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-2010 Ericsson AB. All Rights Reserved.</p>
</div>
</div>
</div></body>
</html>