Instrumentation modes Pin supports two modes of instrumentation called JIT mode and Probe mode. JIT mode supports all features of Pin, while Probe mode supports a limited feature set but is far faster, adding almost no overhead to program's running time. JIT mode uses a just-in-time compiler to recompile all program code and insert instrumentation, while Probe mode uses
code trampolines for instrumentation.
Platform independence Pin was designed for tool
portability, and despite JIT compiling from one ISA to the same ISA (and not using a single
intermediate representation for all code), most of its APIs are architecture and
operating system independent. It was also designed to be portable itself, carefully isolating platform-specific code from generic code, allowing the fast adaptation of Pin to new platforms. Approximately half of the code is generic and the rest is either architecture or OS dependent.
Optimizations Pin uses many techniques to optimize instrumentation and analysis code, using techniques such as
inlining,
liveness analysis and smart
register spilling. Pin performs these optimizations automatically whenever possible, without needing users to insert any extra code to allow inlining. Naturally, some optimizations still require user hints, and some code structures are easier to inline than others. Direct linking of jitted code sections, a technique called
trace linking, and
register binding reconciliation, which minimizes register spilling and remapping, are also used.
Ease of use Pin’s API and implementation are focused on making pin tools easy to write. Pin takes full responsibility for assuring that the instrumentation code from the pin tool does not affect the application state. Also, the API enables instrumentation code to request many pieces of information from Pin. For example, the instrumentation code in the pin tool can use the Pin API to get the memory address being accessed by an instruction, without having to examine the instruction in detail. == Tools ==