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.
A:
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
2010-02-10 09:45:39
What cpus have l2 cache miss profiling? How can I check CPU's ability of measuring it?
osgx
2010-04-05 11:34:16
@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
2010-04-05 17:47:25
I guess all modern intel cpus (capable of running mac os x 10.5) support cache miss perf events.
osgx
2010-04-05 20:59:34
A:
... 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.
- Config->Edit
- flip the View dropdown from Simple to Advanced
- flip the CPU dropdown from "Current (Unknown)" to your CPU
- 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
2010-06-20 01:56:21