<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Project><name>pyprof2calltree</name>
<shortdesc>Help visualize profiling data from cProfile with kcachegrind</shortdesc>
<description>Overview
========

Script to help visualize profiling data collected with the cProfile
python module with the kcachegrind_ (screenshots_) graphical calltree
analyser.

This is a rebranding of the venerable
http://www.gnome.org/~johan/lsprofcalltree.py script by David Allouche
et Al. It aims at making it easier to distribute (e.g. through pypi)
and behave more like the scripts of the debian kcachegrind-converters_
package. The final goal is to make it part of the official upstream
kdesdk_ package.

.. _kcachegrind: http://kcachegrind.sourceforge.net
.. _kcachegrind-converters: http://packages.debian.org/en/stable/kcachegrind-converters
.. _kdesdk: http://websvn.kde.org/trunk/KDE/kdesdk/kcachegrind/converters/
.. _screenshots: http://images.google.fr/images?q=kcachegrind

Authors and contributors
========================

- David Allouche (original author)
- Jp Calderone
- Itamar Shtull-Trauring
- Johan Dahlin
- Olivier Grisel (repackaging and pstats support)
- David Glick (fix in conversion algorithm)


Command line usage
==================

Upon installation you shoould have a `pyprof2calltree` script in your path::

  $ pyprof2calltree --help
  Usage: /usr/bin/pyprof2calltree [-k] [-o output_file_path] [-i input_file_path] [-r scriptfile [args]]

  Options:
    -h, --help            show this help message and exit
    -o OUTFILE, --outfile=OUTFILE
                          Save calltree stats to &lt;outfile&gt;
    -i INFILE, --infile=INFILE
                          Read python stats from &lt;infile&gt;
    -r SCRIPT, --run-script=SCRIPT
                          Name of the python script to run to collect profiling
                          data
    -k, --kcachegrind     Run the kcachegrind tool on the converted data


Python shell usage
==================

`pyprof2calltree` is also best used from an interactive python shell such as
the defaulft shell. For instance let us profile XML parsing::

  &gt;&gt;&gt; from xml.etree import ElementTree
  &gt;&gt;&gt; from cProfile import Profile
  &gt;&gt;&gt; xml_content = '&lt;a&gt;\n' + '\t&lt;b/&gt;&lt;c&gt;&lt;d&gt;text&lt;/d&gt;&lt;/c&gt;\n' * 100 + '&lt;/a&gt;'
  &gt;&gt;&gt; profiler = Profile()
  &gt;&gt;&gt; profiler.runctx(
  ...     "ElementTree.fromstring(xml_content)",
  ...     locals(), globals())

  &gt;&gt;&gt; from pyprof2calltree import convert, visualize
  &gt;&gt;&gt; visualize(profiler.getstats())                            # run kcachegrind
  &gt;&gt;&gt; convert(profiler.getstats(), 'profiling_results.kgrind')  # save for later

or with the ipython_::

  In [1]: %doctest_mode
  Exception reporting mode: Plain
  Doctest mode is: ON

  &gt;&gt;&gt; from xml.etree import ElementTree
  &gt;&gt;&gt; xml_content = '&lt;a&gt;\n' + '\t&lt;b/&gt;&lt;c&gt;&lt;d&gt;text&lt;/d&gt;&lt;/c&gt;\n' * 100 + '&lt;/a&gt;'
  &gt;&gt;&gt; %prun -D out.stats ElementTree.fromstring(xml_content)

  *** Profile stats marshalled to file 'out.stats'

  &gt;&gt;&gt; from pyprof2calltree import convert, visualize
  &gt;&gt;&gt; visualize('out.stats')
  &gt;&gt;&gt; convert('out.stats', 'out.kgrind')

  &gt;&gt;&gt; results = %prun -r ElementTree.fromstring(xml_content)
  &gt;&gt;&gt; visualize(results)

.. _ipython: http://ipython.scipy.org


Change log
==========

 - 1.1.0 - 2008-12-21: integrate fix in conversion by David Glick
 - 1.0.3 - 2008-10-16: fix typos in 1.0 release
 - 1.0 - 2008-10-16: initial release under the pyprof2calltree name</description>
<homepage rdf:resource="http://www.bitbucket.org/ogrisel/pyprof2calltree/overview/" />
<maintainer><foaf:Person><foaf:name>Olivier Grisel</foaf:name>
<foaf:mbox_sha1sum>c2a3bd281b56e0cbe16a8a9fd76c71f922c15ba8</foaf:mbox_sha1sum></foaf:Person></maintainer>
<release><Version><revision>1.1.0</revision></Version></release>
</Project></rdf:RDF>