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源码阅读笔记-块设备驱动程序
块设备驱动程序 块设备驱动程序负责实现对块设备数据的读写功能.内核代码统一使用缓冲块间接和块设备(如磁盘)交换数据,缓冲区数据通过块设备驱动程序和块设备交换数据. 块设备的管理 块设备表 内核通过一张 ...
随机推荐
- OSI参考模型 VS TCP/IP参考模
OSI参考模型 VS TCP/IP参考模 TCP/IP各层对应的协议 TCP/IP的层 对应的TCP/IP协议 ...
- 使用awstats统计分析tengine日志访问量及各种http网站数据
下载awstats最新安装包并解压 cd /usr/local/src wget http://www.awstats.org/files/awstats-7.3.tar.gz tar -zxvf a ...
- 初级SQL开发汇总指南
汇总部分内容来自网络(作者 :zhtbs),比较基础的东西,能够了解比较基础的一些东西. Select语句概要 数据库中数据的提取(查询)使用select 语法,主要有以下几点作用 l 提取的数据 ...
- Socket 错误总结
错误 因为并没有搞清楚accept函数的使用,所以导致不停的发送失败,同时还不知道错误在哪里,无意中看见errno这个库,可以记录错误的原因,才知道原因在于没有用客户端的套接字进行接收数据,而这个客户 ...
- 大话设计模式之策略模式(strategy)
策略模式:它定义了算法家族,分别封装起来,让他们之间可以互相替换,此模式让算法的变化不会影响使用算法的用户. 针对商城收银模式,打折,返现促销等的例子: 打折还是促销其实都是一些算法,可以用工厂模式来 ...
- matlab的常用快捷键
ctrl+shift+d:控制窗口嵌入还是非嵌入
- nodejs广播
http://site.douban.com/185124/widget/notes/10805558/note/240909343/ http://t42dw.iteye.com/blog/1767 ...
- Solr总结
http://www.cnblogs.com/guozk/p/3498831.html Solr调研总结 开发类型 全文检索相关开发 Solr版本 4.2 文件内容 本文介绍solr的功能使用及相关注 ...
- ckeditor与ckfinder简单整合使用
Ckeditor与ckfinder简单整合使用 功能:主要用来发送图文的email,图片上传到本地服务器,但是email的图片地址要写上该服务器的远程地址(图片地址:例如:http://www.bai ...
- Keil C51调试程序时, 对ROM的查看以及RAM 查看或修改
在Keil 里使用 DeBug 模式时,如要 查看外部 RAM 的数据 或查看 ACC 的内容可以进行以下操作; sysGetTxMode: LCALL Com0185(C:2B95) ,sysGet ...