Author_Institution :
Virginia Univ., Charlottesville, VA, USA
Abstract :
Software code caches help amortize the overhead of dynamic binary transformation by enabling reuse of transformed code. Since code caches contain a potentially-altered copy of every instruction that executes, run-time access to a code cache can be a very powerful opportunity. Unfortunately, current research infrastructures lack the ability to model and direct code caching, and as a result, past code cache investigations have required access to the source code of the binary transformation system. This paper presents a code cache-aware interface to the pin dynamic instrumentation system. While a program executes, our interface allows a user to inspect the code cache, receive callbacks when key events occur, and manipulate the code cache contents at will. We demonstrate the utility of this interface on four architectures (IA32, EM64T, IPF, XScale) and present several tools written using our API. These tools include a self-modifying code handler, a two-phase instrumentation analyzer, a code cache visualizer, and custom code cache replacement policies. We also show that tools written using our interface have comparable performance to direct, source-level implementations. Both our interface and sample open-source tools that utilize the interface have been incorporated into the standard distribution of the pin dynamic instrumentation engine, which has been downloaded over 5,000 times in 18 months.
Keywords :
cache storage; program diagnostics; public domain software; software reusability; software tools; API; EM64T; IA32; IPF; XScale; code cache contents manipulation; code cache manipulation; code cache visualizer; code cache-aware interface; cross-architectural interface; custom code cache replacement policies; dynamic binary transformation; open-source tools; pin dynamic instrumentation system; program execution; run-time access; self-modifying code handler; software code caches; transformed code reusability; two-phase instrumentation analyzer; Application software; Costs; Engines; Instruments; Open source software; Power system modeling; Robustness; Runtime; Security; Visualization;