diff options
Diffstat (limited to 'arch/powerpc/kernel/power7-pmu.c')
-rw-r--r-- | arch/powerpc/kernel/power7-pmu.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/power7-pmu.c b/arch/powerpc/kernel/power7-pmu.c index dfac48d8ff45..060e0deb399e 100644 --- a/arch/powerpc/kernel/power7-pmu.c +++ b/arch/powerpc/kernel/power7-pmu.c | |||
@@ -302,6 +302,46 @@ static int power7_generic_events[] = { | |||
302 | [PERF_COUNT_BRANCH_MISSES] = 0x400f6, /* BR_MPRED */ | 302 | [PERF_COUNT_BRANCH_MISSES] = 0x400f6, /* BR_MPRED */ |
303 | }; | 303 | }; |
304 | 304 | ||
305 | #define C(x) PERF_COUNT_HW_CACHE_##x | ||
306 | |||
307 | /* | ||
308 | * Table of generalized cache-related events. | ||
309 | * 0 means not supported, -1 means nonsensical, other values | ||
310 | * are event codes. | ||
311 | */ | ||
312 | static int power7_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = { | ||
313 | [C(L1D)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
314 | [C(OP_READ)] = { 0x400f0, 0xc880 }, | ||
315 | [C(OP_WRITE)] = { 0, 0x300f0 }, | ||
316 | [C(OP_PREFETCH)] = { 0xd8b8, 0 }, | ||
317 | }, | ||
318 | [C(L1I)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
319 | [C(OP_READ)] = { 0, 0x200fc }, | ||
320 | [C(OP_WRITE)] = { -1, -1 }, | ||
321 | [C(OP_PREFETCH)] = { 0x408a, 0 }, | ||
322 | }, | ||
323 | [C(L2)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
324 | [C(OP_READ)] = { 0x6080, 0x6084 }, | ||
325 | [C(OP_WRITE)] = { 0x6082, 0x6086 }, | ||
326 | [C(OP_PREFETCH)] = { 0, 0 }, | ||
327 | }, | ||
328 | [C(DTLB)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
329 | [C(OP_READ)] = { 0, 0x300fc }, | ||
330 | [C(OP_WRITE)] = { -1, -1 }, | ||
331 | [C(OP_PREFETCH)] = { -1, -1 }, | ||
332 | }, | ||
333 | [C(ITLB)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
334 | [C(OP_READ)] = { 0, 0x400fc }, | ||
335 | [C(OP_WRITE)] = { -1, -1 }, | ||
336 | [C(OP_PREFETCH)] = { -1, -1 }, | ||
337 | }, | ||
338 | [C(BPU)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
339 | [C(OP_READ)] = { 0x10068, 0x400f6 }, | ||
340 | [C(OP_WRITE)] = { -1, -1 }, | ||
341 | [C(OP_PREFETCH)] = { -1, -1 }, | ||
342 | }, | ||
343 | }; | ||
344 | |||
305 | struct power_pmu power7_pmu = { | 345 | struct power_pmu power7_pmu = { |
306 | .n_counter = 6, | 346 | .n_counter = 6, |
307 | .max_alternatives = MAX_ALT + 1, | 347 | .max_alternatives = MAX_ALT + 1, |
@@ -313,4 +353,5 @@ struct power_pmu power7_pmu = { | |||
313 | .disable_pmc = power7_disable_pmc, | 353 | .disable_pmc = power7_disable_pmc, |
314 | .n_generic = ARRAY_SIZE(power7_generic_events), | 354 | .n_generic = ARRAY_SIZE(power7_generic_events), |
315 | .generic_events = power7_generic_events, | 355 | .generic_events = power7_generic_events, |
356 | .cache_events = &power7_cache_events, | ||
316 | }; | 357 | }; |