Generating a callgraph by using Doxygen and Graphviz

One of the questions of my OS assignment asks me to draw a callgraph. It can be one-time task and I can draw it on a piece of paper. Soon I noticed that the one that I want to draw is much bigger in size that I can simply draw on a paper. Also I wanted to draw it in ‘fancier’ way. I search the Internet, and I found this is one of the choices.

The following is what I have done.

  1. Install Doxygen and Graphviz. In my case, I only had to install Graphviz (and I am using linux fedora)
    sudo yum install graphviz
  2. Go to the folder where your source files are located.
  3. doxygen -g
    This will generate a configuration file, named ‘Doxyfile’.
  4. Modify Doxyfile if necessary. To generate a callgraph, you need to set up appropriately. I changed the following properties.
    HAVE_DOT               = YES
    EXTRACT_ALL            = YES
    EXTRACT_PRIVATE        = YES
    EXTRACT_STATIC         = YES
    CALL_GRAPH             = YES
  5. Then you run doxygen:
    doxygen Doxyfile
  6. New folder ‘html’ and ‘latex’ will be generated, and you can find all the documentations in the folders.

This is an example of callgraph generated by doxygen.

Image

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s