Basically pin tools are designed as "Just In Time (JIT)" compilers, so the two components behind the architecture are Instrumentation and Analysis Code. As you may know, PIN tools has the ability to instrument the architecture independently. Therefore, as instrumentation occurs immediately before the code sequence execute the first time, you have to treat the program directly with the target benchmark.
Here are some tips:
First of all go to the parent directory of the Pin tool, the general usage of pin is defined as :
pin [OPTION] [-t <tool> [<toolargs>]] -- <command line>
Secondly, export the path of pin to the env to be able to use it everywhere else (in my case is):
Now you can use it everywhere to pin the instrument (compilation counts, branch takens, etc).
There are some sample sources in order to start working around in
$ cd source/tools/ManualExamples
like inscount, linux_buffer, etc. use the make command to g++ compile the source codes:
and then :
$ pin -t inscount0.so -- /bin/ls
to get the output of the /bin/ls.
Hope that helps you.