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. angular 控制器之间值得传递

    <div ng-controller="ParentCtrl"> <!--父级--> <div ng-controller="SelfCtr ...

  2. 为何要fork()两次来避免产生僵尸进程??

    最近安装书上说的,开始搞多进程了..看到了一个好帖子,学习学习 http://blog.sina.com.cn/s/blog_9f1496990100y420.html 首先我们要明白,为什么要避免僵 ...

  3. fineuploader 上传jquery 控件

    fineuploader 昨天用的一个jquery插件. 可参考这篇文章以前写的 file-uploader  跟 这个跟里面介绍的2个jquery 插件相比.觉得更强大写..版本号都3.9 了….. ...

  4. python ^M 产生的原因 及 lxml 如何获取text的原因

    其实跟踪一下会发现,^M 是由于 /r/n 所造成的. article = dom_c.xpath('//td[@id="article_content"]//text()')co ...

  5. Java中getAttribute getParameter 区别

            网上说的不少,发现都是同一篇,汗..... (1)HttpServletRequest类有setAttribute()方法,而没有setParameter()方法 (2)当两个Web组 ...

  6. JdbcTemplate 操作Oracle Blob

    1:增加操作 public int addTest(TestVo tv) { byte bz[] = tv.getBz().getBytes(); LobHandler lobHandler = ne ...

  7. poj 3667 Hotel

    昨天学习了线段树的延迟标记: 发现自己还有区间合并没有学: 抓紧时间学习一下: 代码: #include<cstdio> #include<algorithm> #define ...

  8. 安卓天天练练(三)常用组件Toast

    要写几句java package com.narumi.android_7_2; import android.app.Activity; import android.os.Bundle; impo ...

  9. System.in.read()

     用读取键盘输入必须构建       1.输入流   System.in;       2.字符输入流   InputStreamReader       3.缓存输入流   BufferedRead ...

  10. [LeetCode#202] Roman to Integer

    Problem: Write an algorithm to determine if a number is "happy". A happy number is a numbe ...