Can hardware performance counters be trusted?
Valgrind: a framework for heavyweight dynamic binary instrumentation