<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Guppy — Bcfg2 1.3.0 documentation</title> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../../../', VERSION: '1.3.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/sidebar.js"></script> <link rel="shortcut icon" href="../../../_static/favicon.ico"/> <link rel="top" title="Bcfg2 1.3.0 documentation" href="../../../index.html" /> <link rel="up" title="Plugins" href="../index.html" /> <link rel="next" title="Trigger" href="trigger.html" /> <link rel="prev" title="Svn" href="../version/svn.html" /> <link rel="stylesheet" href="../../../_static/bcfg2.css" type=""/> </head> <body> <div style="text-align: left; padding: 10px 10px 15px 15px"> <a href="../../../index.html"><img src="../../../_static/bcfg2_logo.png" border="0" alt="sampledoc"/></a> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="trigger.html" title="Trigger" accesskey="N">next</a> |</li> <li class="right" > <a href="../version/svn.html" title="Svn" accesskey="P">previous</a> |</li> <li><a href="../../../index.html">home</a> | </li> <!--<li><a href="../../../search.html">search</a> | </li>--> <li><a href="../../../help/index.html">help</a> | </li> <li><a href="../../../contents.html">documentation </a> »</li> <li><a href="../../../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="../../index.html" >The Bcfg2 Server</a> »</li> <li><a href="../index.html" accesskey="U">Plugins</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="guppy"> <span id="server-plugins-misc-guppy"></span><h1>Guppy<a class="headerlink" href="#guppy" title="Permalink to this headline">¶</a></h1> <p>This plugin is used to trace memory leaks within the bcfg2-server process using <a class="reference external" href="http://pypi.python.org/pypi/guppy/0.1.8">Guppy</a>. By default the remote debugger is started when this plugin is enabled. The debugger can be disabled in a running process using <tt class="docutils literal"><span class="pre">bcfg2-admin</span> <span class="pre">xcmd</span> <span class="pre">Guppy.Disable</span></tt> and enabled using <tt class="docutils literal"><span class="pre">bcfg2-admin</span> <span class="pre">xcmd</span> <span class="pre">Guppy.Enable</span></tt>.</p> <div class="section" id="setup"> <h2>Setup<a class="headerlink" href="#setup" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>Install the <a class="reference external" href="http://pypi.python.org/pypi/guppy/0.1.8">Guppy</a> package first.</li> <li>Add <em>Guppy</em> to the <strong>plugins</strong> line in <tt class="docutils literal"><span class="pre">bcfg2.conf</span></tt>.</li> </ul> </div> <div class="section" id="use-cases"> <h2>Use cases<a class="headerlink" href="#use-cases" title="Permalink to this headline">¶</a></h2> <p>To attach the console run:</p> <div class="highlight-python"><pre>python -c "from guppy import hpy;hpy().monitor()"</pre> </div> </div> <div class="section" id="example"> <h2>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h2> <div class="highlight-sh"><div class="highlight"><pre><span class="c"># python -c "from guppy import hpy;hpy().monitor()"</span> <Monitor> *** Connection 1 opened *** <Monitor> lc CID PID ARGV 1 25063 <span class="o">[</span><span class="s1">'/usr/sbin/bcfg2-server'</span>, <span class="s1">'-D'</span>, <span class="s1">'/var/run/bcfg2-server.pid'</span><span class="o">]</span> <Monitor> sc 1 Remote connection 1. To <span class="k">return </span>to Monitor, <span class="nb">type</span> <Ctrl-C> or .<RETURN> <Annex> int Remote interactive console. To <span class="k">return </span>to Annex, <span class="nb">type</span> <span class="s1">'-'</span>. >>> hp.heap<span class="o">()</span> </pre></div> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../../../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Guppy</a><ul> <li><a class="reference internal" href="#setup">Setup</a></li> <li><a class="reference internal" href="#use-cases">Use cases</a></li> <li><a class="reference internal" href="#example">Example</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="../version/svn.html" title="previous chapter">Svn</a></p> <h4>Next topic</h4> <p class="topless"><a href="trigger.html" title="next chapter">Trigger</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../../../_sources/server/plugins/misc/guppy.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../../../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="trigger.html" title="Trigger" >next</a> |</li> <li class="right" > <a href="../version/svn.html" title="Svn" >previous</a> |</li> <li><a href="../../../index.html">home</a> | </li> <!--<li><a href="../../../search.html">search</a> | </li>--> <li><a href="../../../help/index.html">help</a> | </li> <li><a href="../../../contents.html">documentation </a> »</li> <li><a href="../../../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="../../index.html" >The Bcfg2 Server</a> »</li> <li><a href="../index.html" >Plugins</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009-2013, Narayan Desai. Last updated on Mar 20, 2013. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>