I wonder if there is any tool to measure how much a cpp program benefits from caching (L1,L2,L3) ? For example, i) to measure how many requests could be handled directly by cache? ii) how many times the cache got flushed?
Valgrind has a cache profiling utility called cachegrind
Visual Studio (from VS 2010 on) has an embedded profiler which shows information about cache hits and misses, accessible with the CPU Counter options.