The utilization of performance monitoring probes is a valuable tool for programmers to gather performance data. However, the manual insertion of these probes can result in an increase in code size, code obfuscation, and an added burden of learning different APIs associated with performance monitoring tools. To mitigate these issues, EDPM, an embedded domain-specific language, was developed to provide a higher level of abstraction for annotating regions of code that require instrumentation in C and C++ programs. This paper presents the design and implementation of EDPM and compares it to the well-known tool PAPI, in terms of required lines of code, flexibility in configuring regions, and performance overhead. The results of this study demonstrate that EDPM is a low-resolution profiling tool that offers a reduction in required lines of code and enables programmers to express various configurations of regions. Furthermore, the design of EDPM is such that its pragmas are ignored by the standard compiler, allowing for seamless integration into existing software processes without disrupting build systems or increasing the size of the executable. Additionally, the design of the EDPM pre-compiler allows for the extension of available performance counters while maintaining a high level of abstraction for programmers. Therefore, EDPM offers a promising solution to simplify and optimize performance monitoring in C and C++ programs.
翻译:利用性能监控探针是程序员收集性能数据的一种有效手段。然而,手动插入这些探针可能导致代码规模膨胀、代码混淆,以及增加学习不同性能监控工具相关 API 的负担。为解决这些问题,本文开发了嵌入式领域特定语言 EDPM,它提供了更高层次的抽象,用于标注 C 和 C++ 程序中需要插桩的代码区域。本文介绍了 EDPM 的设计与实现,并与知名工具 PAPI 在所需代码行数、区域配置灵活性及性能开销方面进行了比较。研究结果表明,EDPM 是一种低分辨率的性能分析工具,能够减少所需代码行数,并使程序员能够表达区域的不同配置。此外,EDPM 的设计使其编译指示(pragma)会被标准编译器忽略,从而能够无缝集成到现有软件流程中,而不会干扰构建系统或增加可执行文件的大小。同时,EDPM 预编译器的设计允许扩展可用性能计数器,同时为程序员保持高级抽象。因此,EDPM 为简化和优化 C/C++ 程序中的性能监控提供了一种有前景的解决方案。