This
tutorial describes a software instrumentation tool called Pin (http://www.pintool.org). Pin is an ATOM-like instrumentation tool for Linux* executables and is
provided by Intel®. Unlike static instrumentation tools, it allows
code (written in C or C++) to be injected at arbitrary places in an executable
while it is running. The injected code is
used to observe the behavior of the program, and can be used to write branch
predictors, profilers, memory leak detectors, etc. Its robust design and simple
user model makes it easy to do studies that span workstation applications to
complex server applications like commercial databases. Currently supported
platforms include the Intel® Xscale ™, IA-32, EM64T (IA-32 64 bit
extension), and Itanium® microprocessors.
The emphasis of this tutorial
is on using Pin for architecture and compiler research and education. It is
fast and easy to model microarchitectural features in Pin. For example, a
simple data cache model is only 1 page of C code. Instrumentation is typically
much faster than simulation, so it is possible to run entire benchmarks to
completion and to try programs that are difficult to run on a detailed
performance model. For compiler research, Pin is useful for profiling for the
specific conditions where an optimization may apply. For example, a simple
pintool can determine if a memory instruction has a striding reference pattern.
Pin makes it possible to answer what-if questions easily and establish the limits
of the benefit for a particular optimization. After using instrumentation for
initial feasibility studies, then the researcher can implement their ideas in a
detailed performance model or a compiler.
The first session begins with
an introduction to the API and basic concepts for writing instrumentation
tools. With the recent release of Pin 2 for Xscale and IA-32, the API has been
revamped to make it possible to write architecture independent tools. The
presentation highlights the changes.
Session 1 concludes with instruction on how to write instrumentation
tools that are useful for architecture and compiler studies. The second session
consists of presentations on research projects that use Pin. This includes
program phase analysis for instruction trace collection, instruction
prefetching, data race detection in parallel programs, and dynamic
optimization.
1:30
Introduction to Pin API
CK Luk, Intel
2:30
Instrumentation tools for architecture and compiler research
Dan Connors,
3:30 Break
4:00
Instruction Prefetching and Efficient Micro-architecture Simulations
Wei-Chung Hsu, University of Minnesota
Wei will present a framework that combines the Pin tool and the Pfmon
library to support dynamic instruction cache prefetching and efficient
micro-architecture simulations.
4:30