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. python基础之列表常用操作及知识点小结

    列表(list) List(列表) 是 Python 中使用最频繁的数据类型.列表可以完成大多数集合类的数据结构实现.它支持字符,数字,字符串甚至可以包含列表(所谓嵌套).列表用[ ]标识,是pyth ...

  2. python 过滤html方法

    from HTMLParser import HTMLParser class MLStripper(HTMLParser): """ 过滤html方法 "&q ...

  3. Xcode6插件开发

    工欲善其事必先利其器,Xcode是我们做iOS Dev必须掌握的一款开发工具. Xcode本身也是一门Cocoa程序,与其来说它是一个Cocoa程序,是不是意味着,我们可以去动态去让它做某件事,或者监 ...

  4. 机器视觉工具箱-Machine Vision Toolbox for Matlab

    发现了一个机器视觉的Matlab工具箱,分享一下. 机器视觉工具箱(MVT的)规定,在机器视觉和基于视觉的控制有益的多种功能.这是一个有点折衷收集反映作者在光度学,摄影测量,色度学 方面的个人利益.它 ...

  5. Android Studio与Genymontion的安装

    需要安装的软件: VirtualBox 5.1.4 Genymotion 2.7.2 Android Studio 2.1.2 安装步骤: 使用安装版安装Android Studio 1.     执 ...

  6. 自定义UICollectionViewController之后 如何设置UICollectionView的布局方式--备用

    我们很多时候使用UICollectionView 可能都是直接创建 UICollectionView   通过初始化的时候  传入一个布局对象的方式来使用UICollectionView 比如我们之前 ...

  7. 从内部剖析C# 集合之---- HashTable

    这是我在博客园的第一篇文章,写的不好或有错误的地方,望各位大牛指出,不甚感激. 计划写几篇文章专门介绍HashTable,Dictionary,HashSet,SortedList,List 等集合对 ...

  8. Java实现希尔排序

            华杰让我看了一道面试题:现有一段程序S,可以对任意n个数进行排序.如果现在需要对n^2个数进行排序,最少需要调用S多少次?(只允许调用S,不可以做别的操作).         看到了这 ...

  9. SolrCloud阶段总结

    http://www.cnblogs.com/guozk/p/3498844.html SolrCloud阶段总结 开发类型 全文检索相关开发 Solr版本 4.2 文件内容 本文介绍SolrClou ...

  10. 安装drupal练习网站遇到的问题

    1 Skip #conjunction key in __clone() method of core/includes/database/query.inc 解决方案:https://www.dru ...