Bash script for generating a png call graph of a programm.
Uses gprof2dot to convert the callgrind output to a png graph
graph.sh your_program [program_arguements]
A node in the output graph represents a function and has the following layout:
+------------------------------+
| function name |
| total time % ( self time % ) |
| total calls |
+------------------------------+
where:
- total time % is the percentage of the running time spent in this function and all its children;
- self time % is the percentage of the running time spent in this function alone;
- total calls is the total number of times this function was called (including recursive calls).
An edge represents the calls between two functions and has the following layout:
total time %
calls
parent --------------------> children
Where:
- total time % is the percentage of the running time transfered from the children to this parent (if available);
- calls is the number of calls the parent function called the children.
For more information check original repository
- Python: known to work with version 2.7 and 3.3; it will most likely not work with earlier releases.
- Graphviz: tested with version 2.26.3, but should work fine with other versions.
- Valgrind
- Run:
apt-get install python graphviz valgrind
pip install gprof2dot