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)

  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

[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 内核实验环境的更多相关文章

  1. 利用bochs调试Linux 0.11内核

    引导程序调试软件bochs,跟配套的linux0.11内核img下载地址分别是: http://sourceforge.net/projects/bochs/http://www.oldlinux.o ...

  2. Linux 0.11源码阅读笔记-总览

    Linux 0.11源码阅读笔记-总览 阅读源码的目的 加深对Linux操作系统的了解,了解Linux操作系统基本架构,熟悉进程管理.内存管理等主要模块知识. 通过阅读教复杂的代码,锻炼自己复杂项目代 ...

  3. Linux 0.11源码阅读笔记-总结

    总结 Linux 0.11主要包含文件管理和进程管理两个部分.进程管理包括内存管理.进程管理.进程间通信模块.文件管理包含磁盘文件系统,打开文件内存数据.磁盘文件系统包括空闲磁盘块管理,文件数据块的管 ...

  4. Linux 0.11源码阅读笔记-文件管理

    Linux 0.11源码阅读笔记-文件管理 文件系统 生磁盘 未安装文件系统的磁盘称之为生磁盘,生磁盘也可以作为文件读写,linux中一切皆文件. 磁盘分区 生磁盘可以被分区,分区中可以安装文件系统, ...

  5. Linux 0.11下信号量的实现和应用

    Linux 011下信号量的实现和应用 生产者-消费者问题 实现信号量 信号量的代码实现 关于sem_wait和sem_post sem_wait和sem_post函数的代码实现 信号量的完整代码 实 ...

  6. Linux 0.11中write实现

    看了一下Linux 0.11版本号write的实现,首先它在标准头文件unistd.h中有定义 int write(int fildes, const char * buf, off_t count) ...

  7. 【从头到脚品读 Linux 0.11 源码】第一回 最开始的两行代码

    从这一篇开始,您就将跟着我一起进入这操作系统的梦幻之旅! 别担心,每一章的内容会非常的少,而且你也不要抱着很大的负担去学习,只需要像读小说一样,跟着我一章一章读下去就好. 话不多说,直奔主题.当你按下 ...

  8. Linux 0.11源码阅读笔记-中断过程

    Linux 0.11源码阅读笔记-中断过程 是什么中断 中断发生时,计算机会停止当前运行的程序,转而执行中断处理程序,然后再返回原被中断的程序继续运行.中断包括硬件中断和软件中断,硬中断是由外设自动产 ...

  9. Linux 0.11源码阅读笔记-块设备驱动程序

    块设备驱动程序 块设备驱动程序负责实现对块设备数据的读写功能.内核代码统一使用缓冲块间接和块设备(如磁盘)交换数据,缓冲区数据通过块设备驱动程序和块设备交换数据. 块设备的管理 块设备表 内核通过一张 ...

随机推荐

  1. C语言-06数据类型-05 总结

    一.基本数据类型1.int1> long int.long:8个字节 %ld2> short int.short:2个字节 %d %i3> unsigned int.unsigned ...

  2. gcc/g++编译

    1. gcc/g++在执行编译工作的时候,总共需要4步 (1).预处理,生成.i的文件[预处理器cpp] (2).汇编,将预处理后的文件转换成汇编语言,生成文件.s[编译器egcs] (3).编译,将 ...

  3. codevs 1066 引水入城

    传送门 题目描述 Description 在一个遥远的国度,一侧是风景秀美的湖泊,另一侧则是漫无边际的沙漠.该国的行政 区划十分特殊,刚好构成一个N行M列的矩形,如上图所示,其中每个格子都代表一座城 ...

  4. jq总结1

    选择器 /** * 多目标选择器 * 可以选择多个元素或者表达式, * 包装成 jQuery 对象的集合 * 例子:$("div,span") */ $("table t ...

  5. 【Java】Java Platform

    The Java platform has two components: The Java Virtual Machine The Java Application Programming Inte ...

  6. 随时可以给doT模板传任何你想要的值

    我以前一直以为只有传给后台的数据才能用doT模板写入, 其实,随时可以把本地处理的数据,仅仅的一个变量,改头换面成一个it关键字下面的属性. 方法就是在tpl中给它赋值. 要注意的是,首先tpl中的属 ...

  7. Delphi版的完成端口控件

    http://download.csdn.net/user/mike1234567890/uploads/2

  8. Tomcat7+Redis存储Session(转)

    PS:截止到2015-05-12前是不支持Tomcat8的,详情见官网:https://github.com/jcoleman/tomcat-redis-session-manager 前提:你已经部 ...

  9. dump iot表

    SQL> create user scan identified by scan default tablespace users; User created. SQL> grant db ...

  10. bzoj3166

    首先不难想到穷举次大数然后我们只要找到满足这个数是次大数的最大区间即可显然答案只可能是这两种[LL[i]+1,R[i]-1]和[L[i]+1,RR[i]-1]L[i]表示这个数ai左侧第一个比它大的数 ...