On Tue, 12 Apr 2005, Karel Gardas wrote:
cachegrind can also be used to estimate the number (though, not sure how accurate it is, possibly not very). I use Shark to actually get the real number.
Perhaps it's possible that cachegrind is wrong or cache misses differ from platform to platform, but I would tell that I get very good numbers for gcc running on x86 platform:
In my experience Cachegrind can give pretty good numbers for L1 misses, espcially D1, but the L2 misses tend to vary more. I saw this with comparisons against the real numbers reported by the performance counters on an Athlon. However, Cachegrind certainly makes a number of approximations (see section 3.3.7 of http://www.valgrind.org/docs/phd2004.pdf) and so you shouldn't trust it too much. It should give reasonable numbers though.
N