Detailed Pin!
Binary Instrumentation Engine
CGO 2012
Pin Website
Tutorial Schedule
Speaker Bio
Presentation Slides
Call for Participation!
CGO 2012, Pin Tutorial
March 31 2012
San Jose, California

About Pin.

Pin is a dynamic instrumentation system provided by Intel (http://www.pintool.org), which allows C/C++/assembly introspection code to be injected at arbitrary places in a running executable. The injected introspection code is referred to as a Pin tool and is used to observe the behavior of the program. Pin tools can be writtten to perform various functionalities including application profiling, memory leak detection, security, trace generators for the IA32 and Intel64 platforms, running either Windows or Linux. Pin provides a rich API that abstracts away the underlying instruction set idiosyncrasies and allows context information such as register contents to be passed to the injected code as parameters. Pin automatically saves and restores registers that are overwritten by the injected code so the application continues to execute normally. Pin makes it easy to do studies on complex real-life applications, which makes it a useful tool not only for research, but also for education. Pin has been downloaded tens of thousands times, has been cited in over 700 publications, and has over 550 registered mailing list users.

Tutorial Objective .

The tutorial targets researchers, students, and educators alike, and provides a detailed look at Pin, both how to use Pin and how Pin works. Participants will obtain a good undersanding of the Pin API. The tutorial is comprised of four learning components. The first component provides insight into the workings of Pin, and introduces its fundamental instrumentation structures and concepts thru example Pin tools. The second component will present methods and considerations for writing optimal Pintools. The third component introduces useful Pin-based tools that are freely available for download, in particular we will look in detail at the memtrace and membuffer tools, which implement the instrumentation basis for algorithms which need to examine memory accesses. The fourth component will present some of the more advanced Pin APIs, such as signal/exception interception, multi threaded pin tools, Pin interface to debuggers.


Tutorial Schedule .

Overall 4.5 hours

Part One: Overview, Key Concepts (60 min)

The first part of the tutorial provides an introduction to Pin and its basic API for writing instrumentation tools (Pintools). Simple Pintools are used to motivate and explain Pin's just-in-time and ahead-of-time instrumentation features. In addition, we will familiarize the attendees with the various components that make up a distributed Pin kit.

Part Two: Pintools in Detail (50 min)

Dos and Don'ts of Pin tool writing. Methods and considerations for writing optimal Pintools. Description of some larger Pin tools.

Part Three: Pintools in More Detail (60 min)

Pin's largest value comes from its utility in the research community. The tutorial highlights concepts that appeal to language and compiler researchers: memory leak detectors, race condition detectors, and profilers. We will walkthru the memtrace and membuffer tools. We will include concepts that will appeal to computer architecture researchers: cache simulation, branch prediction, multi-core simulation. We will look at how Pin can be used to implement tools for security. Finally, we include concepts that will appeal to operating systems researchers: multi-process simulation, system call emulation.

Part Four: Advanced Pin Usage: Advanced Pin APIs (60 min)

We will present some of the more advanced Pin APIs, and show examples of their usage. Some examples of these are: signal/exception interception, instruction re-writing, multi threaded pin tools, interfacing to debuggers, controlling the Pin code cache.

Part Five: Pin Performance (15 min)

We will present some performance numbers of applications running on Pin with various Pin tools


Presenter Bio .

Tevi Devor is a Staff Engineer at Intel and has been working in the Pin project for the last 7 years. Most recently before this, he worked on ia-32el, Intel's dynamic binary translator used for running IA32 applications on IA64 (Itanium) platforms. Tevi received an M.Sc from Queens University, Kignston Canada in 1985, and a B.Sc from University of Toronto in 1984.