2

I'm trying to use Shark to check for L2 cache misses, but it won't work. All of the other Shark sampling modes work fine.

artless noise
  • 21,212
  • 6
  • 68
  • 105

2 Answers2

0

Not all CPUs support L2 cache miss profiling (it depends on what performance registers the CPU has).

Also note that you only get a sample every N cache misses, so if your code is not doing much (i.e. not accessing uncached memory) then you may not see any samples.

Paul R
  • 208,748
  • 37
  • 389
  • 560
  • What cpus have l2 cache miss profiling? How can I check CPU's ability of measuring it? – osgx Apr 05 '10 at 11:34
  • @osgx: I guess you could just try collecting some samples on whatever CPU you have and see whether it works. What Mac and CPU do you have ? – Paul R Apr 05 '10 at 17:47
  • I guess all modern intel cpus (capable of running mac os x 10.5) support cache miss perf events. – osgx Apr 05 '10 at 20:59
0

... a little late, but chances are, some reason, Shark didn't detect which CPU you are using and assumes you don't have the appropriate hardware performance counters.

  1. Config->Edit
  2. flip the View dropdown from Simple to Advanced
  3. flip the CPU dropdown from "Current (Unknown)" to your CPU
  4. Enable the performance counters of interest. E.g., L2_line_in .

Check out the Intel architecture manuals (#3 I think) for what perf counter does what -- unfortunately, there are often no direct L1/L2/LLC miss counters so you'll need some combination of other counters or use another as an estimate.

leo
  • 1