diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-06-08 03:30:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-08 05:18:27 -0400 |
commit | ad689220614b6c7c0b13b70d742f358e9310e71e (patch) | |
tree | e51e0b1abaf22aa3a3c462590c89103048a694cb /arch | |
parent | 0312af84164215a452f2a94957ebd9bce86e0204 (diff) |
perf_counter, x86: Implement generalized cache event types, add Atom support
Fill in core2_hw_cache_event_id[] with the Atom model specific events.
The events can be used in all the tools via the -e (--event) parameter,
for example "-e l1-misses" or -"-e l2-accesses" or "-e l2-write-misses".
( Note: these are straight from the Intel manuals - not tested yet.)
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/perf_counter.c | 85 |
1 files changed, 84 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c index b1f71ff50256..71590e09d16e 100644 --- a/arch/x86/kernel/cpu/perf_counter.c +++ b/arch/x86/kernel/cpu/perf_counter.c | |||
@@ -285,7 +285,90 @@ static const u64 atom_hw_cache_event_ids | |||
285 | [PERF_COUNT_HW_CACHE_OP_MAX] | 285 | [PERF_COUNT_HW_CACHE_OP_MAX] |
286 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = | 286 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = |
287 | { | 287 | { |
288 | /* To be filled in */ | 288 | [ C(L1D) ] = { |
289 | [ C(OP_READ) ] = { | ||
290 | [ C(RESULT_ACCESS) ] = 0x2140, /* L1D_CACHE.LD */ | ||
291 | [ C(RESULT_MISS) ] = 0, | ||
292 | }, | ||
293 | [ C(OP_WRITE) ] = { | ||
294 | [ C(RESULT_ACCESS) ] = 0x2241, /* L1D_CACHE.ST */ | ||
295 | [ C(RESULT_MISS) ] = 0, | ||
296 | }, | ||
297 | [ C(OP_PREFETCH) ] = { | ||
298 | [ C(RESULT_ACCESS) ] = 0x0, | ||
299 | [ C(RESULT_MISS) ] = 0, | ||
300 | }, | ||
301 | }, | ||
302 | [ C(L1I ) ] = { | ||
303 | [ C(OP_READ) ] = { | ||
304 | [ C(RESULT_ACCESS) ] = 0x0080, /* L1I.READS */ | ||
305 | [ C(RESULT_MISS) ] = 0x0081, /* L1I.MISSES */ | ||
306 | }, | ||
307 | [ C(OP_WRITE) ] = { | ||
308 | [ C(RESULT_ACCESS) ] = -1, | ||
309 | [ C(RESULT_MISS) ] = -1, | ||
310 | }, | ||
311 | [ C(OP_PREFETCH) ] = { | ||
312 | [ C(RESULT_ACCESS) ] = 0, | ||
313 | [ C(RESULT_MISS) ] = 0, | ||
314 | }, | ||
315 | }, | ||
316 | [ C(L2 ) ] = { | ||
317 | [ C(OP_READ) ] = { | ||
318 | [ C(RESULT_ACCESS) ] = 0x4f29, /* L2_LD.MESI */ | ||
319 | [ C(RESULT_MISS) ] = 0x4129, /* L2_LD.ISTATE */ | ||
320 | }, | ||
321 | [ C(OP_WRITE) ] = { | ||
322 | [ C(RESULT_ACCESS) ] = 0x4f2A, /* L2_ST.MESI */ | ||
323 | [ C(RESULT_MISS) ] = 0x412A, /* L2_ST.ISTATE */ | ||
324 | }, | ||
325 | [ C(OP_PREFETCH) ] = { | ||
326 | [ C(RESULT_ACCESS) ] = 0, | ||
327 | [ C(RESULT_MISS) ] = 0, | ||
328 | }, | ||
329 | }, | ||
330 | [ C(DTLB) ] = { | ||
331 | [ C(OP_READ) ] = { | ||
332 | [ C(RESULT_ACCESS) ] = 0x0f40, /* L1D_CACHE_LD.MESI (alias) */ | ||
333 | [ C(RESULT_MISS) ] = 0x0508, /* DTLB_MISSES.MISS_LD */ | ||
334 | }, | ||
335 | [ C(OP_WRITE) ] = { | ||
336 | [ C(RESULT_ACCESS) ] = 0x0f41, /* L1D_CACHE_ST.MESI (alias) */ | ||
337 | [ C(RESULT_MISS) ] = 0x0608, /* DTLB_MISSES.MISS_ST */ | ||
338 | }, | ||
339 | [ C(OP_PREFETCH) ] = { | ||
340 | [ C(RESULT_ACCESS) ] = 0, | ||
341 | [ C(RESULT_MISS) ] = 0, | ||
342 | }, | ||
343 | }, | ||
344 | [ C(ITLB) ] = { | ||
345 | [ C(OP_READ) ] = { | ||
346 | [ C(RESULT_ACCESS) ] = 0x00c0, /* INST_RETIRED.ANY_P */ | ||
347 | [ C(RESULT_MISS) ] = 0x0282, /* ITLB.MISSES */ | ||
348 | }, | ||
349 | [ C(OP_WRITE) ] = { | ||
350 | [ C(RESULT_ACCESS) ] = -1, | ||
351 | [ C(RESULT_MISS) ] = -1, | ||
352 | }, | ||
353 | [ C(OP_PREFETCH) ] = { | ||
354 | [ C(RESULT_ACCESS) ] = -1, | ||
355 | [ C(RESULT_MISS) ] = -1, | ||
356 | }, | ||
357 | }, | ||
358 | [ C(BPU ) ] = { | ||
359 | [ C(OP_READ) ] = { | ||
360 | [ C(RESULT_ACCESS) ] = 0x00c4, /* BR_INST_RETIRED.ANY */ | ||
361 | [ C(RESULT_MISS) ] = 0x00c5, /* BP_INST_RETIRED.MISPRED */ | ||
362 | }, | ||
363 | [ C(OP_WRITE) ] = { | ||
364 | [ C(RESULT_ACCESS) ] = -1, | ||
365 | [ C(RESULT_MISS) ] = -1, | ||
366 | }, | ||
367 | [ C(OP_PREFETCH) ] = { | ||
368 | [ C(RESULT_ACCESS) ] = -1, | ||
369 | [ C(RESULT_MISS) ] = -1, | ||
370 | }, | ||
371 | }, | ||
289 | }; | 372 | }; |
290 | 373 | ||
291 | static u64 intel_pmu_raw_event(u64 event) | 374 | static u64 intel_pmu_raw_event(u64 event) |