diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-19 13:56:02 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-19 13:56:02 -0400 |
| commit | 96ad9999185363a1520434bdc6a775bbb27621f1 (patch) | |
| tree | 518ad695429dd159c075c413a5ff5fe00ee829c3 /arch | |
| parent | 71460af58f8565110160283849db4d6bf7e1efa1 (diff) | |
| parent | 855357a21744e488cbee23a47d2b124035160a87 (diff) | |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf, x86: Fix AMD family 15h FPU event constraints
perf, x86: Fix pre-defined cache-misses event for AMD family 15h cpus
perf evsel: Fix use of inherit
perf hists browser: Fix seg fault when annotate null symbol
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86/kernel/cpu/perf_event_amd.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c index 461f62bbd774..cf4e369cea67 100644 --- a/arch/x86/kernel/cpu/perf_event_amd.c +++ b/arch/x86/kernel/cpu/perf_event_amd.c | |||
| @@ -8,7 +8,7 @@ static __initconst const u64 amd_hw_cache_event_ids | |||
| 8 | [ C(L1D) ] = { | 8 | [ C(L1D) ] = { |
| 9 | [ C(OP_READ) ] = { | 9 | [ C(OP_READ) ] = { |
| 10 | [ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */ | 10 | [ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */ |
| 11 | [ C(RESULT_MISS) ] = 0x0041, /* Data Cache Misses */ | 11 | [ C(RESULT_MISS) ] = 0x0141, /* Data Cache Misses */ |
| 12 | }, | 12 | }, |
| 13 | [ C(OP_WRITE) ] = { | 13 | [ C(OP_WRITE) ] = { |
| 14 | [ C(RESULT_ACCESS) ] = 0x0142, /* Data Cache Refills :system */ | 14 | [ C(RESULT_ACCESS) ] = 0x0142, /* Data Cache Refills :system */ |
| @@ -427,7 +427,9 @@ static __initconst const struct x86_pmu amd_pmu = { | |||
| 427 | * | 427 | * |
| 428 | * Exceptions: | 428 | * Exceptions: |
| 429 | * | 429 | * |
| 430 | * 0x000 FP PERF_CTL[3], PERF_CTL[5:3] (*) | ||
| 430 | * 0x003 FP PERF_CTL[3] | 431 | * 0x003 FP PERF_CTL[3] |
| 432 | * 0x004 FP PERF_CTL[3], PERF_CTL[5:3] (*) | ||
| 431 | * 0x00B FP PERF_CTL[3] | 433 | * 0x00B FP PERF_CTL[3] |
| 432 | * 0x00D FP PERF_CTL[3] | 434 | * 0x00D FP PERF_CTL[3] |
| 433 | * 0x023 DE PERF_CTL[2:0] | 435 | * 0x023 DE PERF_CTL[2:0] |
| @@ -448,6 +450,8 @@ static __initconst const struct x86_pmu amd_pmu = { | |||
| 448 | * 0x0DF LS PERF_CTL[5:0] | 450 | * 0x0DF LS PERF_CTL[5:0] |
| 449 | * 0x1D6 EX PERF_CTL[5:0] | 451 | * 0x1D6 EX PERF_CTL[5:0] |
| 450 | * 0x1D8 EX PERF_CTL[5:0] | 452 | * 0x1D8 EX PERF_CTL[5:0] |
| 453 | * | ||
| 454 | * (*) depending on the umask all FPU counters may be used | ||
| 451 | */ | 455 | */ |
| 452 | 456 | ||
| 453 | static struct event_constraint amd_f15_PMC0 = EVENT_CONSTRAINT(0, 0x01, 0); | 457 | static struct event_constraint amd_f15_PMC0 = EVENT_CONSTRAINT(0, 0x01, 0); |
| @@ -460,18 +464,28 @@ static struct event_constraint amd_f15_PMC53 = EVENT_CONSTRAINT(0, 0x38, 0); | |||
| 460 | static struct event_constraint * | 464 | static struct event_constraint * |
| 461 | amd_get_event_constraints_f15h(struct cpu_hw_events *cpuc, struct perf_event *event) | 465 | amd_get_event_constraints_f15h(struct cpu_hw_events *cpuc, struct perf_event *event) |
| 462 | { | 466 | { |
| 463 | unsigned int event_code = amd_get_event_code(&event->hw); | 467 | struct hw_perf_event *hwc = &event->hw; |
| 468 | unsigned int event_code = amd_get_event_code(hwc); | ||
| 464 | 469 | ||
| 465 | switch (event_code & AMD_EVENT_TYPE_MASK) { | 470 | switch (event_code & AMD_EVENT_TYPE_MASK) { |
| 466 | case AMD_EVENT_FP: | 471 | case AMD_EVENT_FP: |
| 467 | switch (event_code) { | 472 | switch (event_code) { |
| 473 | case 0x000: | ||
| 474 | if (!(hwc->config & 0x0000F000ULL)) | ||
| 475 | break; | ||
| 476 | if (!(hwc->config & 0x00000F00ULL)) | ||
| 477 | break; | ||
| 478 | return &amd_f15_PMC3; | ||
| 479 | case 0x004: | ||
| 480 | if (hweight_long(hwc->config & ARCH_PERFMON_EVENTSEL_UMASK) <= 1) | ||
| 481 | break; | ||
| 482 | return &amd_f15_PMC3; | ||
| 468 | case 0x003: | 483 | case 0x003: |
| 469 | case 0x00B: | 484 | case 0x00B: |
| 470 | case 0x00D: | 485 | case 0x00D: |
| 471 | return &amd_f15_PMC3; | 486 | return &amd_f15_PMC3; |
| 472 | default: | ||
| 473 | return &amd_f15_PMC53; | ||
| 474 | } | 487 | } |
| 488 | return &amd_f15_PMC53; | ||
| 475 | case AMD_EVENT_LS: | 489 | case AMD_EVENT_LS: |
| 476 | case AMD_EVENT_DC: | 490 | case AMD_EVENT_DC: |
| 477 | case AMD_EVENT_EX_LS: | 491 | case AMD_EVENT_EX_LS: |
