Skip to content
Pintool demonstration for JMU Unix Users Group
C++ Makefile Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Pintool demonstration for JMU Unix Users Group

Installing Pin

To install Pin, you can use the provided script:


It will download and extract Pin into your $HOME/opt folder (creating it first if necessary). If you run into problems, you can always grab the most recent distribution from the official website and extract it somewhere yourself.

Compiling Pintools

First, you must make sure that the PIN_ROOT environment variable is set to the installation directory. If you use Bash and the provided installation script worked for you, you can use the provided environment setup script:

source /

If you installed Pin to a different location, you will need to modify the script or just set PIN_ROOT manually.

After this, you should be able to compile the provided Pintools with make.

Running Pintools

Normally, you run Pintools with a command similar to the following:

$PIN_ROOT/pin -t path/to/ -- </path/to/app> <app-options>

However, for this demonstration the only important parts are the name of the particular tool that is being run (ToolName) and the application-specific part (everything after the --). Therefore, you can use the provided run script to make things cleaner on the command line:

./ <ToolName> </path/to/app> <app-options>

For instance, the following command will run the function profiler on a traceroute:

./ FuncProfile traceroute

Note that (as with compilation) this will fail if you don't have $PIN_ROOT set to the Pin installation folder.

Writing Pintools

The easiest way to create your own Pintool is just to copy one of the existing .cpp files and modify it. You will need to add your new tool to the TEST_TOOL_ROOTS variable in Makefile.rules.

For more information, see the Building Your Own Tool section of the User Manual as well as the API Reference.

You can’t perform that action at this time.