Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 7e647d9940d31b34c253e6f71c416c4b > files > 2716

bzr-2.7.0-6.mga7.aarch64.rpm


<!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="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Profiling &#8212; Bazaar 2.7.0 documentation</title>
    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></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/language_data.js"></script>
    
    <link rel="shortcut icon" href="_static/bzr.ico"/>

    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Tracking Bugs in Bazaar" href="bug-handling.html" />
    <link rel="prev" title="Bazaar Release Cycles" href="cycle.html" />
<link rel="stylesheet" href="_static/bzr-doc.css" type="text/css" />
 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="bug-handling.html" title="Tracking Bugs in Bazaar"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="cycle.html" title="Bazaar Release Cycles"
             accesskey="P">previous</a> |</li>
<li><a href="http://bazaar.canonical.com/">
    <img src="_static/bzr icon 16.png" /> Home</a>&nbsp;|&nbsp;</li>
<a href="http://doc.bazaar.canonical.com/en/">Documentation</a>&nbsp;|&nbsp;</li>

        <li class="nav-item nav-item-0"><a href="index.html">Developer Document Catalog (2.7.0)</a> &#187;</li>
 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="profiling">
<h1>Profiling<a class="headerlink" href="#profiling" title="Permalink to this headline">¶</a></h1>
<div class="section" id="using-profilers">
<h2>Using profilers<a class="headerlink" href="#using-profilers" title="Permalink to this headline">¶</a></h2>
<p>Bazaar has some built-in support for collecting and saving profiling
information. In the simpliest case, the <code class="docutils literal notranslate"><span class="pre">--lsprof</span></code> option can be used as
shown below:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">bzr</span> <span class="o">--</span><span class="n">lsprof</span> <span class="o">...</span>
</pre></div>
</div>
<p>This will dump the profiling information to stdout before exiting.
Alternatively, the <code class="docutils literal notranslate"><span class="pre">--lsprof-file</span></code> option can be used to specify a filename
to save the profiling data into to. By default, profiling data saved to a
file is a pickled Python object making it possible to reload the data and
do with it what you will. For convenience though:</p>
<ul class="simple">
<li>if the filename ends in <code class="docutils literal notranslate"><span class="pre">.txt</span></code>, it will be dumped in a text format.</li>
<li>if the filename either starts with <code class="docutils literal notranslate"><span class="pre">callgrind.out</span></code> or ends with
<code class="docutils literal notranslate"><span class="pre">.callgrind</span></code>, it will be converted to a format loadable by the
KCacheGrind visualization tool.</li>
</ul>
<p>Note that KCacheGrind’s Open Dialog has a default filter than only shows
files starting with <code class="docutils literal notranslate"><span class="pre">callgrind.out</span></code> so the longer filename is usually
preferable. Here is an example of how to use the <code class="docutils literal notranslate"><span class="pre">--lsprof-file</span></code> option
in combination with KCacheGrind to visualize what the <code class="docutils literal notranslate"><span class="pre">status</span></code> command
is doing:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">bzr</span> <span class="o">--</span><span class="n">lsprof</span><span class="o">-</span><span class="n">file</span> <span class="n">callgrind</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">st001</span> <span class="n">status</span>
<span class="n">kcachegrind</span> <span class="n">callgrind</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">st001</span> <span class="o">&amp;</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">bzr also has a <code class="docutils literal notranslate"><span class="pre">--profile</span></code> option that uses the hotshot profiler
instead of the lsprof profiler. The hotshot profiler can be useful
though the lsprof one is generally recommended. See
<a class="reference external" href="http://docs.python.org/lib/node795.html">http://docs.python.org/lib/node795.html</a>.</p>
</div>
<p>Note that to use <code class="docutils literal notranslate"><span class="pre">--lsprof</span></code> you must install the lsprof module, which you
can get with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">svn</span> <span class="n">co</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">codespeak</span><span class="o">.</span><span class="n">net</span><span class="o">/</span><span class="n">svn</span><span class="o">/</span><span class="n">user</span><span class="o">/</span><span class="n">arigo</span><span class="o">/</span><span class="n">hack</span><span class="o">/</span><span class="n">misc</span><span class="o">/</span><span class="n">lsprof</span>
</pre></div>
</div>
</div>
<div class="section" id="profiling-locks">
<h2>Profiling locks<a class="headerlink" href="#profiling-locks" title="Permalink to this headline">¶</a></h2>
<p>Bazaar can log when locks are taken or released, which can help in
identifying unnecessary lock traffic.  This is activated by the <code class="docutils literal notranslate"><span class="pre">-Dlock</span></code>
global option.</p>
<p>This writes messages into <code class="docutils literal notranslate"><span class="pre">~/.bzr.log</span></code>.
At present this only logs actions relating to the on-disk lockdir.  It
doesn’t describe actions on in-memory lock counters, or OS locks (which
are used for dirstate.)</p>
</div>
<div class="section" id="profiling-hpss-requests">
<h2>Profiling HPSS Requests<a class="headerlink" href="#profiling-hpss-requests" title="Permalink to this headline">¶</a></h2>
<p>When trying to improve network performance, it is often useful to know
what requests are being made, and how long they are taking. The <code class="docutils literal notranslate"><span class="pre">-Dhpss</span></code>
global option will enable logging smart server requests, including the
time spent in each request.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Profiling</a><ul>
<li><a class="reference internal" href="#using-profilers">Using profilers</a></li>
<li><a class="reference internal" href="#profiling-locks">Profiling locks</a></li>
<li><a class="reference internal" href="#profiling-hpss-requests">Profiling HPSS Requests</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="cycle.html"
                        title="previous chapter">Bazaar Release Cycles</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="bug-handling.html"
                        title="next chapter">Tracking Bugs in Bazaar</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/profiling.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <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>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="bug-handling.html" title="Tracking Bugs in Bazaar"
             >next</a></li>
        <li class="right" >
          <a href="cycle.html" title="Bazaar Release Cycles"
             >previous</a> |</li>
<li><a href="http://bazaar.canonical.com/">
    <img src="_static/bzr icon 16.png" /> Home</a>&nbsp;|&nbsp;</li>
<a href="http://doc.bazaar.canonical.com/en/">Documentation</a>&nbsp;|&nbsp;</li>

        <li class="nav-item nav-item-0"><a href="index.html">Developer Document Catalog (2.7.0)</a> &#187;</li>
 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2009-2011 Canonical Ltd.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.4.
    </div>
  </body>
</html>