diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2010-05-08 07:39:52 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-05-08 08:17:52 -0400 |
commit | de902d967feb96f2dfddfbe9dbd69dc22fd5ebcb (patch) | |
tree | f3f22deb11cf38e71cb4f08871a5d4a9e2e074f5 /arch | |
parent | 6e85158cf5a2385264316870256fb6ad681156a0 (diff) |
x86, perf: P4 PMU -- configure predefined events
If an event is not RAW we should not exit p4_hw_config
early but call x86_setup_perfctr as well.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: Robert Richter <robert.richter@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_p4.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index 9e002054cb5f..b1f532d1d36f 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -439,21 +439,20 @@ static int p4_hw_config(struct perf_event *event) | |||
439 | if (p4_ht_active() && p4_ht_thread(cpu)) | 439 | if (p4_ht_active() && p4_ht_thread(cpu)) |
440 | event->hw.config = p4_set_ht_bit(event->hw.config); | 440 | event->hw.config = p4_set_ht_bit(event->hw.config); |
441 | 441 | ||
442 | if (event->attr.type != PERF_TYPE_RAW) | 442 | if (event->attr.type == PERF_TYPE_RAW) { |
443 | return 0; | 443 | /* |
444 | 444 | * We don't control raw events so it's up to the caller | |
445 | /* | 445 | * to pass sane values (and we don't count the thread number |
446 | * We don't control raw events so it's up to the caller | 446 | * on HT machine but allow HT-compatible specifics to be |
447 | * to pass sane values (and we don't count the thread number | 447 | * passed on) |
448 | * on HT machine but allow HT-compatible specifics to be | 448 | * |
449 | * passed on) | 449 | * XXX: HT wide things should check perf_paranoid_cpu() && |
450 | * | 450 | * CAP_SYS_ADMIN |
451 | * XXX: HT wide things should check perf_paranoid_cpu() && | 451 | */ |
452 | * CAP_SYS_ADMIN | 452 | event->hw.config |= event->attr.config & |
453 | */ | 453 | (p4_config_pack_escr(P4_ESCR_MASK_HT) | |
454 | event->hw.config |= event->attr.config & | 454 | p4_config_pack_cccr(P4_CCCR_MASK_HT)); |
455 | (p4_config_pack_escr(P4_ESCR_MASK_HT) | | 455 | } |
456 | p4_config_pack_cccr(P4_CCCR_MASK_HT)); | ||
457 | 456 | ||
458 | return x86_setup_perfctr(event); | 457 | return x86_setup_perfctr(event); |
459 | } | 458 | } |