【24h】

Hybrid Binary Rewriting for Memory Access Instrumentation

机译:用于内存访问工具的混合二进制重写

获取原文
获取原文并翻译 | 示例

摘要

Memory access instrumentation is fundamental to many applications such as software transactional memory systems, profiling tools and race detectors. We examine the problem of efficiently instrumenting memory accesses in x86 machine code to support software transactional memory and profiling. We aim to automatically instrument all shared memory accesses in critical sections of x86 binaries, while achieving overhead close to that obtained when performing manual instrumentation at the source code level. The two primary options in building such an instrumentation system are static and dynamic binary rewriting: the former instruments binaries at link time before execution, while the latter binary rewriting instruments binaries at runtime. Static binary rewriting offers extremely low overhead but is hampered by the limits of static analysis. Dynamic binary rewriting is able to use runtime information but typically incurs higher overhead. This paper proposes an alternative: hybrid binary rewriting. Hybrid binary rewriting is built around the idea of a persistent instrumentation cache (PIC) that is associated with a binary and contains instrumented code from it. It supports two execution modes when using instrumentation: active and passive modes. In the active execution mode, a dynamic binary rewriting engine (PIN) is used to intercept execution, and generate instrumentation into the PIC, which is an on-disk file. This execution mode can take full advantage of runtime information. Later, passive execution can be used where instrumented code is executed out of the PIC. This allows us to attain overheads similar to those incurred with static binary rewriting. This instrumentation methodology enables a variety of static and dynamic techniques to be applied. For example, in passive mode, execution occurs directly from the original executable save for regions that require instrumentation. This has allowed us to build a low-overhead transactional memory profiler. We also demonstrate how we can use the combination of static and dynamic techniques to eliminate instrumentation for accesses to locations that are thread-private.
机译:内存访问工具对于许多应用程序来说都是基础,例如软件事务存储系统,配置文件工具和竞争检测器。我们研究了在x86机器代码中有效检测内存访问以支持软件事务性内存和性能分析的问题。我们旨在自动检测x86二进制文件关键部分中的所有共享内存访问,同时使开销接近于在源代码级执行手动检测时获得的开销。构建此类检测系统的两个主要选项是静态和动态二进制重写:前者在执行前的链接时执行二进制文件,而后者在运行时进行二进制重写。静态二进制重写提供了极低的开销,但受到静态分析的限制。动态二进制重写能够使用运行时信息,但通常会产生更高的开销。本文提出了一种替代方案:混合二进制重写。混合二进制重写是围绕与二进制文件关联并包含来自二进制文件的已检测代码的持久性检测缓存(PIC)的思想构建的。使用检测时,它支持两种执行模式:主动模式和被动模式。在主动执行模式下,动态二进制重写引擎(PIN)用于拦截执行,并生成对磁盘上文件PIC的检测。该执行模式可以充分利用运行时信息。以后,可以在从PIC之外执行检测代码的地方使用被动执行。这使我们可以获得类似于静态二进制重写所产生的开销。这种检测方法可以应用多种静态和动态技术。例如,在被动模式下,执行直接从原始可执行文件执行,但需要检测的区域除外。这使我们能够构建开销较低的事务性内存分析器。我们还演示了如何结合使用静态技术和动态技术来消除对线程专用位置进行访问的手段。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号