1

I've been trying to instrument SPEC CPU2006 benchmarks using Intel's Pin on Ubuntu. I have a Pintool with a simple cache simulator that counts reads and writes. When running the Pintool on a 'runspec -nonreportable' command for a specific benchmark I get the data I want. However, the results of different benchmarks hardly differ at all. My pintool doesn't seem to be the problem as it looks to be working correctly on other applications. I suspect the results are due to the Pintool is instrumenting everything including the setup of the benchmark.

What I've previously done it just running the pintool on the runspec command. I've also tried to use '--action build' and '--action setup' prior to using runspec to reduce the overhead, but it seems like runs much of the same setup anyway. I know there are monitoring hooks in SPEC CPU 2006 where I can run additional commands right before starting a benchmark, and I'm thinking there might be someway in which I can use those but I'm know sure how. Maybe the 'monitor_wrapper' hook is most appropriate? Maybe I can get a hold of the pid somehow and attach my pintool to the correct process just as the benchmark is starting? Super thankful for any help I can get!

  • 1
    It seems like I've been looking at too advanced solutions. I've now found this: https://www.spec.org/cpu2006/Docs/runspec-avoidance.html which lets me run the benchmark without runspec. This instead uses specinvoke which should, according to my understanding, introduce minimal overhead and run the benchmark by itself. If you are knowledgeable on the subject feel free to confirm or deny this. – JustAnotherUser Jun 22 '19 at 20:35
  • 1
    You where right! I only instrumented runspec itself. I added the command switch -follow_execv which did the trick. I also ran the benchmark with specinvoke instead (as per these instructions https://www.spec.org/accel/docs/runspec-avoidance.html) in order to avoid some of runspec's overhead. You are welcome to post your comment as an answer instead so I can mark this question as solved. – JustAnotherUser Jul 06 '19 at 19:58

1 Answers1

1

You're probably just instrumenting runspec itself, which runs in a process that creates another process in which the benchmark is run. You have two options: either tell Pin to follow child processes (using the -follow_execv option) or directly inject Pin into the process of the benchmark when it gets created (by running the benchmark using specinvoke instead of runspec).

Hadi Brais
  • 22,259
  • 3
  • 54
  • 95