Pin (computer program): Difference between revisions

Content deleted Content added
m Per Wikipedia Style Manual: corrected punctuation of unprintworthy terms, heading capitalization; removed excess punctuation; defined initialism; changed instances of passive voice to active.
Line 2:
| developer = [[Intel]]
| latest release version = 2.8
| latest release date = {{release date|11|03|2010 }}
| operating_system = [[Linux]] and, [[Windows]].
| platform = [[IA32IA-32]], [[Intel64x86-64]] and [[IA64IA-64]]
| genre = [[instrumentation_Instrumentation (computer_programmingcomputer programming)|Instrumentation Frameworkframework]], [[Profiler_Profiling (computer_sciencecomputer programming)|Profiler]]
| license = [[Proprietary software|Proprietary]], given free of charge for non-commercial use.
| website = [http://www.pintool.org/ www.pintool.org]
}}
 
'''Pin''' is a dynamic binary [[instrumentation_instrumentation (computer_programmingcomputer programming)|instrumentation]] framework for the [[IA32IA-32]], [[Intel64x86-64]] and [[IA64IA-64]] [[instruction set|instruction set architectures]] that enables the creation of [[dynamic program analysis]] tools. Some tools built with Pin are [[Intel Parallel Inspector]], [[Intel Parallel Amplifier]] and [[Intel Parallel Advisor]].
 
The tools created using Pin, called Pintools, can be used to perform program analysis on [[user space]] applications in [[Linux]] and [[Windows]]<ref>[http://www.cs.virginia.edu/kim/docs/ispass10.pdf Dynamic Program Analysis of Microsoft Windows Applications]</ref> and [[Linux]]. Since Pin isAs a dynamic binary instrumentation tool, the instrumentation is performed at [[run time]] on the compiled binary files. ItThus, thereforeit doesrequires notno require re-compilationrecompiling of the source code and can support the instrumentation ofinstrumenting programs that dynamically generate code.
 
Pin was originally created as a tool for computer architecture analysis, but its flexible API and an active community (called "Pinheads") have created a diverse set of tools for security, emulation and parallel program analysis.
Line 19:
 
==Overview==
Pin performs instrumentation by taking control of the program just after it loads into memory. It then [[justJust-in-time compilation|just-in-time re-compilesrecompiles]] (JIT) small sections of binary code just before they are run. New instructions, which perform the analysis, are added to the re-compiledrecompiled code. These new instructions come from the Pintool. A large array of optimization techniques are used to obtain the lowest possible running time and memory consumption overhead. As of June 2010, Pin's average base overhead is 30 per cent (without running a pintool)<ref>[http://www.cs.virginia.edu/kim/docs/ieeeComputer10.pdf Analyzing Parallel Programs with Pin]</ref>.
 
Pin is a platform for the creation of analysis tools. A pin tool comprises instrumentation, analysis and callback [[routine|routines]]. Instrumentation routines are called when code that has not yet been recompiled is about to be run, and enable the insertion of analysis routines. Analysis routines are called when the code they are associated with is run. Callback routines are called when specific conditions are met, or when a certain event has occurred. Pin provides an extensive [[Application Programming Interface|API]] for instrumentation at many abstraction levels, from a single instruction to an entire binary module. It also supports callbacks for many events such as library loads, system calls, signals/exceptions and thread creation events.
 
Pin is a platform for the creation ofcreating analysis tools. A pin tool comprises instrumentation, analysis and callback [[routine|routines]]. Instrumentation routines are called when code that has not yet been recompiled is about to be run, and enable the insertion of analysis routines. Analysis routines are called when the code they are associated with is run. Callback routines are called when specific conditions are met, or when a certain event has occurred. Pin provides an extensive [[Application Programming Interface|API]] for instrumentation at many abstraction levels, from a single instruction to an entire binary module. It also supports callbacks for many events such as library loads, system calls, signals/exceptions and thread creation events.
 
== Features ==
=== Instrumentation Modesmodes ===
Pin supports two modes of instrumentation called JIT mode and Probe mode. JIT mode supports all the features of Pin, while Probe mode supports a limited feature set but is much faster, adding almost no overhead to program running time. JIT mode uses a just-in-time compiler to recompile all program code and insert instrumentation, while Probe mode uses [[Trampoline_Trampoline (computers)|code trampolines]] for instrumentation.
 
=== Platform independence ===
Pin was designed withfor tool portability in mind, 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 independent and [[Operatingoperating Systemsystem]] 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.<ref>[http://www.cs.virginia.edu/papers/p190-luk.pdf Pin: Building Customized Program Analysis Tools with Dynamic Instrumentation]</ref>
 
=== Optimizations ===
Pin uses many techniques to optimize instrumentation and analysis code, using techniques such as [[Inline function|inlining]], [[liveness analysis]] and smart [[register spilling]]. Pin performs these optimizations automatically whenever possible, without requiring the user 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.
, [[liveness analysis]] and smart [[register spilling]]. Pin performs these optimizations automatically whenever possible, without requiring the user 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 Useuse===
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 the 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.
 
Line 63 ⟶ 61:
== External Links ==
 
* [http://www.pintool.org/ Pin's: a dynamic binary instrumentation tool] home page].
* [http://tech.groups.yahoo.com/group/pinheads/ Pinheads], a mailing list for the Pin users community.