Doxygen with Graphviz to generate call graph on Mac
Doxygen and Graphviz
Doxygen
Doxygen is a documentation generator primarily used for c++ code. More on doxygen can be found here.?http://www.doxygen.nl/
Graghviz
Doxygen can use the “dot” tool from graphviz to generate more advanced diagrams and graphs. Graphviz is an open-source, cross-platform graph drawing toolkit and can be found at?http://www.graphviz.org/. This can do a lot more things but I have used it for my c project so using it to generate the call graphs.
Steps to generate call/caller graph
Install doxygen and Graphviz. I was using mac os?macOS Mojave
1. brew install doxygen 2. brew install graphvizGenerate Doxyfile. Goto the project folder and do
doxygen -gEdit the doxygen file to add the below configs
HAVE_DOT = YES EXTRACT_ALL = YES EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES CALL_GRAPH = YES CALLER_GRAPH = YES DISABLE_INDEX = YES GENERATE_TREEVIEW = YES RECURSIVE = YESNote:
RECURSIVE is to consider the subfolders in the project. DISABLE_INDEX and GENERATE_TREEVIEW is to get rid of the index view in the html file that will get generated and have a tree like view. I like it this way. If you are ok with the default setting, can get rid of this option.Run Doxygen
doxygen DoxyfileThe HTML and latex folders are generated now. You can access the index.html file from the browser to see the results.
Here is the call graph created for the inotify_add_watch system call implementation in Linux kernel
inotify_add_watch
總結
以上是生活随笔為你收集整理的Doxygen with Graphviz to generate call graph on Mac的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Python】Matplotlib在概
- 下一篇: 计数后打印垂直柱状图(洛谷P1598题题