Skip to content

Visualize function calls with Graphviz (Source code by M. Tim Jones)

Notifications You must be signed in to change notification settings

DrGeoff/pvtrace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pvtrace

Visualize function calls with Graphviz (Source code by M. Tim Jones)

By utilizing the gcc compiler option -finstrument-functions a dynamic function address trace can be recorded. The pvtrace utility provide by this project converts that record into a dot graph that can then be visualised.

An article containing full details of this procedure and how it works behind the scenes was written by the pvtrace source code author M. Tim Jones. This article was available on IBMs developer works website in 2005 and a pdf version can be found in this repository.

After downloading the source code use make to create the pvtrace executable.

The process for creating the call trace graph of your application is as follows:

Compile in the instrumentation

gcc -g -finstrument-functions instrument.c all-your-apps-source-files.c -o exename

Run the executable to generate the stack trace (output is trace.txt)

./exename

Convert the trace.txt to a graphviz dot file (output is graph.dot)

pvtrace exename

Convert the dot graph into a jpeg for visualisation (output is graph.jpg)

dot -Tjpg graph.dot -o graph.jpg

About

Visualize function calls with Graphviz (Source code by M. Tim Jones)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published