Profiling CPU cache in Linux

We can see how effectively cache is being used by using:

valgrind --tool=cachegrind ls
cachegrind is a tool for doing cache simulations and annotating your source line-by-line with the number of cache misses. In particular, it records: