C程序函数调用关系

阅读源码

安装

1
2
3
4
5
6
7
sudo apt-get install cflow graphviz
sudo apt-get install gawk

wget -c https://github.com/tinyclub/linux-0.11-lab/raw/master/tools/tree2dotx
wget -c https://github.com/tinyclub/linux-0.11-lab/raw/master/tools/callgraph
sudo cp tree2dotx callgraph /usr/local/bin
sudo chmod +x /usr/local/bin/{tree2dotx,callgraph}

使用

1
callgraph -f main

参考

  • 源码分析:静态分析 C 程序函数调用关系图
  • 看开源代码利器—用Graphviz + CodeViz生成C/C++函数调用图(call graph)