Pintool demonstration for JMU Unix Users Group
This fork contains additional tools for floating-point analysis.
To install Pin, you can use the provided script:
./install_pin.sh
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.
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 /setup_env.sh
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
.
Normally, you run Pintools with a command similar to the following:
$PIN_ROOT/pin -t path/to/ToolName.so -- </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:
./run.sh <ToolName> </path/to/app> <app-options>
For instance, the following command will run the function profiler on a traceroute:
./run.sh FuncProfile traceroute jmu.edu
Note that (as with compilation) this will fail if you don't have $PIN_ROOT
set to the Pin installation folder.
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.