cflow察看工程函数调用关系+Linux 0.11 内核实验环境
http://savannah.gnu.org/projects/cflow
http://tinylab.org/linux-0.11-lab/
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 May :: PM UTC - replies GNU cflow version 1.5 is available for download. Changes in this release: Correctly handle functions returning struct/union (fixes bug #)
Gracefully handle invalid inputs (fixes bug #)
Debugging output goes to stderr
Add a manpage
Consistent use of exit codes Version 1.4 released
posted by gray, Tue Oct :: PM UTC - 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 ). 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)
cflow -b -m start_kernel init/main.c > start_kernel.txt
2.tree2dotx: 把函数调用树转换成 dot 格式
cat start_kernel.txt | tree2dotx > start_kernel.dot
3.用 dot 工具生成可以渲染的图片格式
这里仅以 svg 格式为例:
$ cat start_kernel.dot | dot -Tsvg -o start_kernel.svg
[root@server1 l#git clone https://github.com/tinyclub/linux-0.11-lab.git && cd linux-0.11-lab
[root@server1 l#cd tool
[root@server1 l#cp tree2dotx callgraph /usr/local/bin
[root@server1 l#chmod +x /usr/local/bin/{tree2dotx,callgraph} [root@server1 linux-0.11-lab]# make cg f=main //Makefile.callgraph
Func: main
Match:
File:
./init/main.c: * main() use the stack at all after fork(). Thus, no function
./init/main.c: * won't be any messing with the stack from main(), but we define
./init/main.c:void main(void) /* This really IS void, no error here. */
Select: ~ ?
File: ./init/main.c
Command: cflow -b -m main ./init/main.c | /root/soft/linux-0.11-lab/tools//tree2dotx 2>/dev/null | dot -Tsvg -o /root/soft/linux-0.11-lab/tools//../callgraph/main.__init_main_c.svg
cflow:./init/main.c:: drive_info redefined
cflow:./init/main.c:: this is the place of previous definition
Target: ./init/main.c: main -> /root/soft/linux-0.11-lab/tools//../callgraph/main.__init_main_c.svg
which: no chromium-browser in (/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin) 图像生成:
[root@server1 callgraph]# pwd
/root/soft/linux-0.11-lab/callgraph
[root@server1 callgraph]# ll
total 28
-rw-r--r-- 1 root root 22196 Jun 8 15:48 main.__init_main_c.svg
-rw-r--r-- 1 root root 34 Jun 8 15:45 Makefile

cflow察看工程函数调用关系+Linux 0.11 内核实验环境的更多相关文章
- 利用bochs调试Linux 0.11内核
引导程序调试软件bochs,跟配套的linux0.11内核img下载地址分别是: http://sourceforge.net/projects/bochs/http://www.oldlinux.o ...
- Linux 0.11源码阅读笔记-总览
Linux 0.11源码阅读笔记-总览 阅读源码的目的 加深对Linux操作系统的了解,了解Linux操作系统基本架构,熟悉进程管理.内存管理等主要模块知识. 通过阅读教复杂的代码,锻炼自己复杂项目代 ...
- Linux 0.11源码阅读笔记-总结
总结 Linux 0.11主要包含文件管理和进程管理两个部分.进程管理包括内存管理.进程管理.进程间通信模块.文件管理包含磁盘文件系统,打开文件内存数据.磁盘文件系统包括空闲磁盘块管理,文件数据块的管 ...
- Linux 0.11源码阅读笔记-文件管理
Linux 0.11源码阅读笔记-文件管理 文件系统 生磁盘 未安装文件系统的磁盘称之为生磁盘,生磁盘也可以作为文件读写,linux中一切皆文件. 磁盘分区 生磁盘可以被分区,分区中可以安装文件系统, ...
- Linux 0.11下信号量的实现和应用
Linux 011下信号量的实现和应用 生产者-消费者问题 实现信号量 信号量的代码实现 关于sem_wait和sem_post sem_wait和sem_post函数的代码实现 信号量的完整代码 实 ...
- Linux 0.11中write实现
看了一下Linux 0.11版本号write的实现,首先它在标准头文件unistd.h中有定义 int write(int fildes, const char * buf, off_t count) ...
- 【从头到脚品读 Linux 0.11 源码】第一回 最开始的两行代码
从这一篇开始,您就将跟着我一起进入这操作系统的梦幻之旅! 别担心,每一章的内容会非常的少,而且你也不要抱着很大的负担去学习,只需要像读小说一样,跟着我一章一章读下去就好. 话不多说,直奔主题.当你按下 ...
- Linux 0.11源码阅读笔记-中断过程
Linux 0.11源码阅读笔记-中断过程 是什么中断 中断发生时,计算机会停止当前运行的程序,转而执行中断处理程序,然后再返回原被中断的程序继续运行.中断包括硬件中断和软件中断,硬中断是由外设自动产 ...
- Linux 0.11源码阅读笔记-块设备驱动程序
块设备驱动程序 块设备驱动程序负责实现对块设备数据的读写功能.内核代码统一使用缓冲块间接和块设备(如磁盘)交换数据,缓冲区数据通过块设备驱动程序和块设备交换数据. 块设备的管理 块设备表 内核通过一张 ...
随机推荐
- sublime text 2代码片段(Snippet)功能的使用
“snippet”在英语里面是“片段”的意思.当我们编码时候,通常想要打几个简略的字符串,就出来一些固定的模板. 例如:使用snippet在新建文件时快速生成HTML头部信息等. 定义很简单,菜单:t ...
- thinkphp路径引用问题
查看ThinkPHP\Library\Behavior\ContentReplaceBehavior.class文件,常量定义如下定义: '__ROOT__' => __ROOT__ ...
- Hdu 3177 Crixalis's Equipment
Crixalis's Equipment Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...
- [BZOJ 3888] [Usaco2015 Jan] Stampede 【线段树】
题目链接:BZOJ - 3888 题目分析 首先,计算出每个线段在 x 坐标 0 处出现的时间开始点和结束点,就转成了时间轴上的线段. 然后就是看每条线段是否被 y 比它小的线段完全覆盖了.注意求出的 ...
- Java学习IO篇
来吧,同志们,为复习网络编程做准备-- 一.理论准备 流是个抽象的概念,是对输入输出设备的抽象,Java程序中,对于数据的输入/输出操作都是以"流" ...
- ios7新特性3-Map Kit新特性
Map Kit 框架 (MapKit.framework) 包含了大量的改进以及为基于地图的程序提供了新特性.利用地图显示位置信息的应用现在可以使用Maps这个程序用到的3D地图,包括控制程序控制视线 ...
- edgejs
http://krasimirtsonev.com/blog/article/Real-time-chat-with-NodeJS-Socketio-and-ExpressJS https://git ...
- hibernate异常:Could not determine type for: java.util.Set
根本原因:我实体类中的类型是raw,没法直接实例化的类型.private List<String> rightChoices;private Set<String> multi ...
- javascript中神奇的(+)加操作符
javascript是一门神奇的语言,这没神奇的语言中有一个神奇的加操作符. 常用的加操作符我们可以用来做: 加法运算,例如:alert(1+2); ==>3 字符串连接,例如:alert(“a ...
- 在 ActionBar 添加刷新按钮
在以前版本的 Gmail 应用中,ActionBar 上有个刷新菜单,点击一下刷新菜单变成一个转圈的刷新标示动画图片. 之前实现该功能的时候都是使用一个类库 RefreshActionItem来实现的 ...