cflow察看工程函数调用关系

Posted zengkefu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了cflow察看工程函数调用关系相关的知识,希望对你有一定的参考价值。

http://savannah.gnu.org/projects/cflow

http://ftp.gnu.org/gnu/cflow/

https://github.com/tinyclub

http://www.tinylab.org/callgraph-draw-the-calltree-of-c-functions/

1.cflow版本:   //Calltree 不更新了,CFLOW还在更新中
./configure
make
make install


Version 1.5 available posted by gray, Mon 16 May 2016 09:39:12 PM UTC - 0 replies GNU cflow version 1.5 is available for download. Changes in this release: Correctly handle functions returning struct/union (fixes bug #31792) Gracefully handle invalid inputs (fixes bug #44113) Debugging output goes to stderr Add a manpage Consistent use of exit codes Version 1.4 released posted by gray, Tue 11 Oct 2011 09:08:54 PM UTC - 0 replies GNU cflow version 1.4 is available for download. The most important changes in this version are: Symbol aliases New syntactic class: qualifiers Speed up recursive call detection. Fix parsing of typedefs after struct. Fix the output of branch marks in tree mode. Fix processing of static inline functions (RH bug 650716).


 2.yum install graphviz //得到dot
3.yum install gawk
4.tree2dotx (脚本,和gprof2dot.py一样)转换 .DOT图形格式
wget -c https://github.com/tinyclub/linux-0.11-lab/raw/master/tools/tree2dotx

callgraph = cflow + tree2dotx + dot  (callgraph自动化这个三个工具)

1.cflow:拿到函数调用关系  (calltree可以互换cflow)

  1. cflow -b -m start_kernel init/main.c > start_kernel.txt

2.tree2dotx: 把函数调用树转换成 dot 格式

  1. cat start_kernel.txt | tree2dotx > start_kernel.dot

3.用 dot 工具生成可以渲染的图片格式

这里仅以 svg 格式为例:

  1. $ cat start_kernel.dot | dot -Tsvg -o start_kernel.svg


 

以上是关于cflow察看工程函数调用关系的主要内容,如果未能解决你的问题,请参考以下文章

cflow——C语言函数调用关系生成器

cflow——C语言函数调用关系生成器

如何在makefile中使用cflow?

AspectJ——切入点语法之cflow与cflowbelow

AspectJ——切入点语法之cflow与cflowbelow

JMeter接口测试-模块控制器