Orca Python Call Graph
|
Yesterday I saw a link on popurls.com to pycallgraph, a Python library that will generate call graphs and thought that I'd give it a try with Orca |
I had to wait until today to download it, as being popular knocked out their server. I also had to install Graphviz, a prerequisite. That was easy. Just a few clicks away via the Synaptic Package manager on my Ubuntu system.
Integrating the pycallgraph code into Orca was trivial. Two lines near the start of the application:
import pycallgraph pycallgraph.start_trace()
and then two lines just before it terminates:
pycallgraph.stop_trace()
pycallgraph.make_graph('orca-call-graph.png')
Creating the call graph counts is very CPU and memory intensive, so I then had to make a couple other adjustments to the Orca code, to convince it that it hadn't commited suicide:
- turn off the watchdog process than pings Orca to see if it was
still alive.
- turn off the timeout callback with Orca, so that it wouldn't think it was hung.
If anybody else is interested, here's the full set of diffs I had to make to Orca.
As Orca was pretty much unusable whilst these statistics were being instrumented, I just started up Orca and once it had fully started, I then just terminated it.
That generated a 16188 x 4187 PNG Orca call graph image, which is quite awkward to view.
Although it's interesting and quite clever (and probably very helpful with small, simple Python applications), I think in order to be useful with Orca, the call graph data needs to be in a different format. Maybe just plain old ASCII table entry. Bonus points if it can do a function tree hierarchical view usage in ASCII too. I also wonder whether this is something that an appropriate set of DTrace probes would solve, so much more simply.
Any good simple alternative Python call graph packages out there?
[Technorati Tag: Performance Testing]
( Feb 13 2007, 11:12:41 AM PST ) [Listen] Permalink Comments [3]
Comments are closed for this entry.













Posted by 62.142.195.131 on February 15, 2007 at 05:18 AM PST #
Posted by 62.142.195.131 on February 15, 2007 at 05:24 AM PST #
Posted by Rich Burridge on February 15, 2007 at 07:52 AM PST #