• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2025, Vol. 47 ›› Issue (8): 1343-1353.

• 高性能计算 • 上一篇    下一篇

基于FT-X DSP轨迹跟踪的插桩工具设计与实现

魏臻1,2,原玉磊1,刘月辉1,2,莫家胜1,2,扈啸1,2   

  1. (1.国防科技大学计算机学院,湖南 长沙 410073;
    2.先进微处理器芯片与系统重点实验室,湖南 长沙 410073) 
  • 收稿日期:2024-10-08 修回日期:2024-10-25 出版日期:2025-08-25 发布日期:2025-08-27
  • 基金资助:
    湖南省自然科学基金(2024JJ6470)

Design and implementation of an  instrumentation tool based on FT-X DSP tracing

WEI Zhen1,2,YUAN Yulei1,LIU Yuehui1,2,MO Jiasheng1,2,HU Xiao1,2   

  1. (1.College of Computer Science and Technology,National University of Defense Technology,Changsha  410073;
    2.Key Laboratory of Advanced Microprocessor Chips and Systems,Changsha 410073,China)

  • Received:2024-10-08 Revised:2024-10-25 Online:2025-08-25 Published:2025-08-27

摘要: 程序插桩技术包括动态技术和静态技术,在程序执行过程中主要用于动态分析,广泛应用于漏洞挖掘、缺陷检测、性能分析与优化等领域,是进行程序执行路径收集、函数调用分析的主要手段。在嵌入式系统中,传统的插桩方法常常因无操作系统、复杂体系结构和有限内存等限制而难以实施。以静态插桩算法为研究目的,聚焦嵌入式系统调试场景中的插桩需求,除了介绍程序插桩技术的基本原理,系统性地分析目前插桩的典型方法以外,设计并实现了基于FT-X DSP轨迹跟踪的插桩工具Dbtrace。同时,针对插桩开销问题,全面测量了不同插桩方案程序执行的时间开销和代码膨胀率,并与未插桩的程序进行对比。实验结果表明,Dbtrace能有效跟踪和记录程序执行的轨迹信息,降低了内存占用和插桩开销,可以有效解决嵌入式系统的插桩调试问题。

关键词: 嵌入式系统, 数字信号处理器, 静态插桩, 函数调用, 轨迹跟踪

Abstract: Program instrumentation technique encompasses both dynamic technique and static technique,primarily employed for dynamic analysis during program execution.It is widely applied in areas such as vulnerability discovery,defect detection,performance analysis and optimization,serving as a key method for collecting program execution paths and analyzing function calls.In embedded systems,traditional instrumentation methods often face challenges due to constraints such as the absence of an operating system,complex architecture,and limited memory.This paper focuses on static instrumentation algorithms,addressing the instrumentation requirements in embedded system debugging scenarios.In addition to introducing the fundamental principles of program instrumentation and systematically analyzing current typical instrumentation methods,we designed and implemented Dbtrace,an instrumentation tool based on FT-X DSP tracing.Furthermore,to address the overhead issue,we comprehensively measured the execution time overhead and code expansion rate of different instrumentation schemes,comparing them with an uninstrumented program.Experimental results demonstrate that Dbtrace can effectively track and record program execution traces information while reducing memory usage and instrumentation overhead,providing an efficient solution for instrumentation debugging in embedded systems.


Key words: embedded system, digital signal processor, static instrumentation, function call, tracing