Orca Python Call Graph
By user12607856 on Feb 13, 2007
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:
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
- 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?