摘要
进行精确的软件性能分析,需要在代码中插入测量和控制代码,并根据具体运行状态动态的检查多个不同的参数。但是,用静态类型的程序语言,如 C 语言等书写的代码,一经编译和链接,其处理逻辑即不可更改。因此,在无法获取源代码或者重新编译和重新启动代价较高的应用中,对软件进行动态性能分析非常困难。本文将介绍一种在软件运行时刻动态插入监控点的动态指令编译技术对软件进行监控,从而在上述情况下达到对软件的监控目的。这种方法是基于 DynInst API 和 PAPI 技术的。实验表明,这种方法在去掉了对源代码的依赖的情况下,仍然与在源代码级插入监控点的方法具有同等的采集效率,在很大程度上增强了基于硬件性能计数器方法的软件监控技术的应用范围,达到了较好的性能分析效果。
In wish to do dynamic software performance analysis, many different qualities should be checked according to the running context, and survey and control instructions must insert into code dynamically. But the inner process logic of a program written by static type languages like C is stable and fixed after compiled and linked. So, when source code is not free to get and modify, or when rewriting and restarting a running program is not an option, it is difficult to do software performance analysis. A new dynamic instruments compiling technology is introduced here. It is based on the technology of Dyninst API and PAPI. Using dynamic instruments compiling, performance analysis is independent to source code, and only associates to running status and image of a program. This paper shows how to use dynamic instruments compiling and hardware performance counters to do dynamic software performance analysis.
出处
《计算机科学》
CSCD
北大核心
2006年第4期292-294,F0003,共4页
Computer Science