论文标题

最低覆盖仪器

Minimum Coverage Instrumentation

论文作者

Chen, Li, Hoag, Ellis, Lee, Kyungwoo, Mestre, Julian, Pupyrev, Sergey

论文摘要

现代编译器利用块覆盖率数据进行下游配置文件引导的优化,以改善运行时性能和二进制的大小。给定二进制中一个函数的控制流图$ g =(v,e)$,其中$ v $中的节点对应于基本块(始终顺序执行的指令序列),并且$ e $中的边缘表示控制流中的跳跃,目标是在会议中执行的每个块$ u \ u \ u \ u \ u \ u \ u $ u $ in the the ecection the Chunce中的目标。为此,需要将执行块执行时记录的额外仪器代码添加到二进制中。此额外的代码会创建一个时间和空间开销,这希望尽可能最小化。在此应用程序的启发下,我们研究了最小覆盖仪器问题,目标是找到仪器的最小尺寸子集,以便可以从仪器子集的覆盖范围中推断出图中其余块的覆盖范围。我们的主要结果是一种算法,以找到最佳的仪器策略,并在$ o(| e |)$时间中进行推断。我们还研究了这个基本问题的变体,其中我们有兴趣学习边缘而不是节点的覆盖范围,或者仅允许我们仪器边缘而不是节点时。

Modern compilers leverage block coverage profile data to carry out downstream profile-guided optimizations to improve the runtime performance and the size of a binary. Given a control-flow graph $G=(V, E)$ of a function in the binary, where nodes in $V$ correspond to basic blocks (sequences of instructions that are always executed sequentially) and edges in $E$ represent jumps in the control flow, the goal is to know for each block $u \in V$ whether $u$ was executed during a session. To this end, extra instrumentation code that records when a block is executed needs to be added to the binary. This extra code creates a time and space overhead, which one would like to minimize as much as possible. Motivated by this application, we study the Minimum Coverage Instrumentation problem, where the goal is to find a minimum size subset of blocks to instrument such that the coverage of the remaining blocks in the graph can be inferred from the coverage status of the instrumented subset. Our main result is an algorithm to find an optimal instrumentation strategy and to carry out the inference in $O(|E|)$ time. We also study variants of this basic problem in which we are interested in learning the coverage of edges instead of the nodes, or when we are only allowed to instrument edges instead of the nodes.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源