PROMPT:一种快速且可扩展的内存剖析框架
PROMPT: A Fast and Extensible Memory Profiling Framework
AI总结:
针对内存剖析工具开发门槛高的问题,提出PROMPT框架,让开发者仅需定义核心逻辑即可快速构建工具,大幅减少代码量并提升剖析速度,还可高效支持复杂编译器优化的定制需求。
摘要:
内存剖析可捕获程序的动态内存行为,辅助程序员进行调试、调优,并支持基于推测的自动并行化等高级编译器优化。由于每个用例都需要独特的程序轨迹摘要,各类内存剖析工具已被开发出来。然而,设计实用的内存剖析工具通常需要丰富的编译器专业知识、熟练的程序优化能力以及大量的实现工作。这往往导致一种空缺:人们对快速且稳健的剖析工具的期望难以实现。为弥补这一差距,本文提出了PROMPT,这是一个用于简化快速内存剖析工具开发的开创性框架。借助该框架,开发者只需指定剖析事件并定义核心剖析逻辑,无需处理自定义插桩的复杂问题,也不用涉及复杂的内存剖析组件与优化。两款最先进的内存剖析工具已通过PROMPT移植,且所有功能均得以保留。通过聚焦核心剖析逻辑,代码量减少了65%以上,剖析速度分别提升了5.3倍和7.1倍。为进一步凸显PROMPT的作用,本文为一个复杂的编译器优化客户端构建了定制化的内存剖析工作流。仅用570行代码,这个重新设计的工作流就满足了客户端的内存剖析需求,同时与原始剖析工具相比,剖析时间减少了90%以上,稳健性也有所提升。
英文摘要:
Memory profiling captures programs' dynamic memory behavior, assisting programmers in debugging, tuning, and enabling advanced compiler optimizations like speculation-based automatic parallelization. As each use case demands its unique program trace summary, various memory profiler types have been developed. Yet, designing practical memory profilers often requires extensive compiler expertise, adeptness in program optimization, and significant implementation efforts. This often results in a void where aspirations for fast and robust profilers remain unfulfilled. To bridge this gap, this paper presents PROMPT, a pioneering framework for streamlined development of fast memory profilers. With it, developers only need to specify profiling events and define the core profiling logic, bypassing the complexities of custom instrumentation and intricate memory profiling components and optimizations. Two state-of-the-art memory profilers were ported with PROMPT while all features preserved. By focusing on the core profiling logic, the code was reduced by more than 65% and the profiling speed was improved by 5.3x and 7.1x respectively. To further underscore PROMPT's impact, a tailored memory profiling workflow was constructed for a sophisticated compiler optimization client. In just 570 lines of code, this redesigned workflow satisfies the client's memory profiling needs while achieving more than 90% reduction in profiling time and improved robustness compared to the original profilers.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。