loading...
 This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
International Symposium on Code Generation and Optimization (CGO'06)
A Cross-Architectural Interface for Code Cache Manipulation
New York, New York
March 26-March 29
ISBN: 0-7695-2499-0
Kim Hazelwood, University of Virginia
Robert Cohn, Intel Corporation

Software code caches help amortize the overhead of dynamic binary transformation by enabling reuse of transformed code. Since code caches contain a potentiallyaltered 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.

Citation:
Kim Hazelwood, Robert Cohn, "A Cross-Architectural Interface for Code Cache Manipulation," cgo, pp.17-27, International Symposium on Code Generation and Optimization (CGO'06), 2006
Usage of this product signifies your acceptance of the Terms of Use.