Reputation: 20140
I need something like cache hits/misses on a per thread basis. How do I obtain that information? Cachegrind doesn't seem to work, based on the fact that my sequential program gives a count of X instructions executed, and of Y for my parallel program, all OK, except for the fact that X=Y.
I assume Cachegrind is not for threads? Any other tools I could use?
Upvotes: 2
Views: 899
Reputation: 15218
You can use perf to get the information you want from the hardware performance counters.
try:
$ perf stat -e cache-misses,cache-references /bin/ls /tmp/
...
Performance counter stats for '/bin/ls /tmp/':
3,534 cache-misses # 16.605 % of all cache refs
21,283 cache-references
0.001649284 seconds time elapsed
Upvotes: 2