I have a program where I'm trying to trace (instruction trace) with Intel's Pin program (v3.25). The commands I'm running:
pin -t obj-intel64/inscount0.so -- <my binary>
perf stat --event=instructions:{k,u} -- <my binary>
However, the reported number of instructions is wildly different (10x difference) with perf report much much more.
When I used the itrace.so program and the replayed the instructions, I also noticed way fewer instructions than I would've expected for the program. So it got me thinking that there might be something wrong with the pin setup. But I'm not sure where to go from here to debug. Any advice?