aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorJaswinder Singh Rajput <jaswinder@kernel.org>2009-06-12 15:36:21 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-13 06:58:25 -0400
commitf4db43a38f7387c3b19c9565124c06ab0c5d6e9a (patch)
tree8917f86eda4ecfdd1c826a77ac301225acabb417 /arch/x86/kernel/cpu
parent4d2be1267fcfb3a4d2198fd696aec5e3dcbce60e (diff)
perf_counter, x86: Update AMD hw caching related event table
All AMD models share the same hw caching related event table. Also complete the table with more events. Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Cc: Robert Richter <robert.richter@amd.com> 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: <1244835381.2802.2.camel@ht.satnam> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index 3c37c3930ca1..77a59a5566a8 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -389,23 +389,23 @@ static u64 intel_pmu_raw_event(u64 event)
389 return event & CORE_EVNTSEL_MASK; 389 return event & CORE_EVNTSEL_MASK;
390} 390}
391 391
392static const u64 amd_0f_hw_cache_event_ids 392static const u64 amd_hw_cache_event_ids
393 [PERF_COUNT_HW_CACHE_MAX] 393 [PERF_COUNT_HW_CACHE_MAX]
394 [PERF_COUNT_HW_CACHE_OP_MAX] 394 [PERF_COUNT_HW_CACHE_OP_MAX]
395 [PERF_COUNT_HW_CACHE_RESULT_MAX] = 395 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
396{ 396{
397 [ C(L1D) ] = { 397 [ C(L1D) ] = {
398 [ C(OP_READ) ] = { 398 [ C(OP_READ) ] = {
399 [ C(RESULT_ACCESS) ] = 0, 399 [ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */
400 [ C(RESULT_MISS) ] = 0, 400 [ C(RESULT_MISS) ] = 0x0041, /* Data Cache Misses */
401 }, 401 },
402 [ C(OP_WRITE) ] = { 402 [ C(OP_WRITE) ] = {
403 [ C(RESULT_ACCESS) ] = 0, 403 [ C(RESULT_ACCESS) ] = 0x0042, /* Data Cache Refills from L2 */
404 [ C(RESULT_MISS) ] = 0, 404 [ C(RESULT_MISS) ] = 0,
405 }, 405 },
406 [ C(OP_PREFETCH) ] = { 406 [ C(OP_PREFETCH) ] = {
407 [ C(RESULT_ACCESS) ] = 0, 407 [ C(RESULT_ACCESS) ] = 0x0267, /* Data Prefetcher :attempts */
408 [ C(RESULT_MISS) ] = 0, 408 [ C(RESULT_MISS) ] = 0x0167, /* Data Prefetcher :cancelled */
409 }, 409 },
410 }, 410 },
411 [ C(L1I ) ] = { 411 [ C(L1I ) ] = {
@@ -418,17 +418,17 @@ static const u64 amd_0f_hw_cache_event_ids
418 [ C(RESULT_MISS) ] = -1, 418 [ C(RESULT_MISS) ] = -1,
419 }, 419 },
420 [ C(OP_PREFETCH) ] = { 420 [ C(OP_PREFETCH) ] = {
421 [ C(RESULT_ACCESS) ] = 0, 421 [ C(RESULT_ACCESS) ] = 0x014B, /* Prefetch Instructions :Load */
422 [ C(RESULT_MISS) ] = 0, 422 [ C(RESULT_MISS) ] = 0,
423 }, 423 },
424 }, 424 },
425 [ C(LL ) ] = { 425 [ C(LL ) ] = {
426 [ C(OP_READ) ] = { 426 [ C(OP_READ) ] = {
427 [ C(RESULT_ACCESS) ] = 0, 427 [ C(RESULT_ACCESS) ] = 0x037D, /* Requests to L2 Cache :IC+DC */
428 [ C(RESULT_MISS) ] = 0, 428 [ C(RESULT_MISS) ] = 0x037E, /* L2 Cache Misses : IC+DC */
429 }, 429 },
430 [ C(OP_WRITE) ] = { 430 [ C(OP_WRITE) ] = {
431 [ C(RESULT_ACCESS) ] = 0, 431 [ C(RESULT_ACCESS) ] = 0x017F, /* L2 Fill/Writeback */
432 [ C(RESULT_MISS) ] = 0, 432 [ C(RESULT_MISS) ] = 0,
433 }, 433 },
434 [ C(OP_PREFETCH) ] = { 434 [ C(OP_PREFETCH) ] = {
@@ -438,8 +438,8 @@ static const u64 amd_0f_hw_cache_event_ids
438 }, 438 },
439 [ C(DTLB) ] = { 439 [ C(DTLB) ] = {
440 [ C(OP_READ) ] = { 440 [ C(OP_READ) ] = {
441 [ C(RESULT_ACCESS) ] = 0, 441 [ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */
442 [ C(RESULT_MISS) ] = 0, 442 [ C(RESULT_MISS) ] = 0x0046, /* L1 DTLB and L2 DLTB Miss */
443 }, 443 },
444 [ C(OP_WRITE) ] = { 444 [ C(OP_WRITE) ] = {
445 [ C(RESULT_ACCESS) ] = 0, 445 [ C(RESULT_ACCESS) ] = 0,
@@ -1465,16 +1465,10 @@ static int amd_pmu_init(void)
1465 1465
1466 x86_pmu = amd_pmu; 1466 x86_pmu = amd_pmu;
1467 1467
1468 switch (boot_cpu_data.x86) { 1468 /* Events are common for all AMDs */
1469 case 0x0f: 1469 memcpy(hw_cache_event_ids, amd_hw_cache_event_ids,
1470 case 0x10: 1470 sizeof(hw_cache_event_ids));
1471 case 0x11:
1472 memcpy(hw_cache_event_ids, amd_0f_hw_cache_event_ids,
1473 sizeof(hw_cache_event_ids));
1474 1471
1475 pr_cont("AMD Family 0f/10/11 events, ");
1476 break;
1477 }
1478 return 0; 1472 return 0;
1479} 1473}
1480 1474