Need Call Tree Analyzer For Python

Rob Renaud rpgnmets at aol.com
Tue Dec 24 22:19:48 EST 2002


holger krekel <pyth at devel.trillke.net> wrote in message news:<mailman.1040770951.10277.python-list at python.org>...
> Tim Daneliuk wrote:
> > Is anyone aware of a utility which can read a stand-alone Python program
> > and generate a visual representation of the call tree? (That is, a
> > picture of which methods and functions are called and by whom.) Better still
> > would be one that optionally generates a variety of output formats -
> > nroff, txt, pdf, ps, html, ...
> 
> Getting to the call tree requires runtime analysis.  
> IIRC some people tried extracting some information using sys.settrace.  
> 
> Additionally, the actual "call tree" can take multiple pathes 
> because it depends on external signals (e.g. user input).  
> 
> I'd be interested in a tool that handles this, too :-)
> 
>     holger

Static anaysis would be very useful, even if it it cannot show the
'full picture'.  It would probably be a much easier problem to solve
as well.

The easiest way would probably to generate a file that dot can read,
and let it solve the problem of drawing the graph (which it does quite
well, IMO).

http://www.research.att.com/sw/tools/graphviz/



More information about the Python-list mailing list