《计算机应用研究》|Application Research of Computers

基于内核跟踪的动态函数调用图生成方法

Dynamic call graph based on OS kernel trace

免费全文下载 (已被下载 次)  
获取PDF全文
作者 向勇,汤卫东,杜香燕,孙卫真
机构 1.清华大学 计算机科学与技术系,北京 100084;2.首都师范大学 信息工程学院,北京 100048
统计 摘要被查看 次,已被下载
文章编号 1001-3695(2015)04-1095-05
DOI 10.3969/j.issn.1001-3695.2015.04.032
摘要 针对目前大多数的函数调用关系分析工具无法分析函数指针、系统启动过程以及可加载模块的函数调用关系的现象,在CG-RTL的基础上提出了基于内核跟踪的动态函数调用图生成方法,并开发了动态函数调用图生成工具DCG-RTL(dynamic call graph based on RTL)。DCG-RTL在S2E模拟器中运行待跟踪内核,通过指令捕获插件和函数解析插件记录运行时的函数调用和返回信息,分析跟踪信息得到动态和静态函数调用关系,利用CG-RTL工具在浏览器中展示。实验结果表明,DCG-RTL能全面和准确地跟踪包括函数指针引用和可加载内核模块在内的函数调用关系。
关键词 内核跟踪;内核函数调用检测;函数符号解析;函数指针;函数调用图;内核可加载模块
基金项目 核高基项目(2012ZX01039-003,2012ZX01039-004-01-3)
本文URL http://www.arocmag.com/article/01-2015-04-032.html
英文标题 Dynamic call graph based on OS kernel trace
作者英文名 XIANG Yong, TANG Wei-dong, DU Xiang-yan, SUN Wei-zhen
机构英文名 1. Dept. of Computer Science & Technology, Tsinghua University, Beijing 100084, China; 2. College of Information Engineering, Capital Normal University, Beijing 100048, China
英文摘要 Most of currently function call relationships analysis tools can not analyse pointer function, system start processing and loadable kernel module, in order to solve the above problem, this paper proposed on a way based on CG-RTL with the name “dynamic call graph based on OS kernel tracking” and developed a call graph tool binding static and dynamic functions(DCG-RTL).First running system in virtual machine(S2E), and the same time tracing function called and returned information through LinuxCallMonitor and SymbolResovler Plugins, second regulated the data into standized data, and last binding dynamic and static data into CG-RTL.DCG-RTL inherited and developmented CG-RTL made it more humanized and easy to use and provided more functional. Experimental results show that, DCG-RTL can provide pointor function relationships, and can analyse the function call with loadable modules.
英文关键词 kernel trace; kernel function calls detect; system function analytic; function pointer; function call graph; load-able kernel module
参考文献 查看稿件参考文献
  [1] GORMAN M. CodeViz:a call graph generation utility for C/C++[EB/OL] . http://www. skynet. ie/~mel/projects/codeviz/.
[2] GUSTAFSSON A. Egypt-create call graph from GCC RTL dump[EB/OL] . (2013). http://www. gson. org/egypt/egypt. html.
[3] LATTNER C. Introduction to the LLVM compiler infrastructure〓〓〓〓[C] //Proc of Itanium Conference and Expo. 2006.
[4] CHAN S C , GAO G R, CHAPMAN B. Open64 compiler infrastructure for emerging multicore/manycore architecture[C] //Proc of IEEE International Symposium on Parallel and Distributed Processing. [S. l. ] :IEEE Press, 2008:1.
[5] JACOB B, LARSON P, LEITAO B, et al. SystemTap:instrumenting the Linux kernel for analyzing performance and functional problems[K] . [S. l. ] :IBM Redbook, 2008.
[6] GRAHAM S L, KESSLER P B, MCHUSICK M K. Gprof:a call graph execution profiler[J] . ACM SIGPLAN Notices, 1982, 17(6):120-126.
[7] WEIDENDORFER J. Sequential performance analysis with callgrind and Kcachegrind[M] //Tools for High Performance Computing. Berlin:Springer, 2008:93-113.
[8] ROSTEDT S. Finding origins of latencies using Ftrace[EB/OL] . (2009). http://lwn. net/images/conf/rtlws11/papers/proc/p02. pdf.
[9] KORANNE S. Handbook of open source tools[M] . [S. l. ] :Springer, 2010.
[10] KENISTON J, PANCHAMUKHI P, HIRAMATSU M. Kernel probes (Kprobes)[EB/OL] . http://wenku. it168. com/d_000298233. shtml.
[11] JOHNSON C D. Process control instrumentation technology[M] . [S. l. ] :Prentice Hall PTR, 1993.
[12] CHEN Xue-ling. SimSight:a virtual machine based dynamic call graph generator[D] . [S. l. ] :University of Nebraska-Lincoln, 2010.
[13] MAGUSSON P S, CHRISTENSSON M, ESKILSON J, et al. Simics:a full system simulation platform[J] . Computer, 2002, 35(2):50-58.
[14] CHIPOUNOV V, KUZBETSOV V, CANDEA G. S2E:a platform for in-VIVO multi-path analysis of software systems[J] . ACM SIGARCH Computer Architecture News, 2011, 39(1):265-278.
[15] 孙卫真, 杜香燕, 向勇, 等. 基于RTL的函数调用图生成工具CG-RTL[J] . 小型微型计算机系统, 2014, 35(3):555-559.
[16] GANSNER E R, NORTH S C. An open graph visualization system and its applications to software engineering[J] . Software Practice and Experience, 2000, 30(11):1203-1233.
收稿日期 2014/4/14
修回日期 2014/5/22
页码 1095-1099
中图分类号 TP311.56
文献标志码 A