summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/perf_event.c
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2010-04-13 22:23:12 +0200
committerIngo Molnar <mingo@elte.hu>2010-05-07 11:31:00 +0200
commit9d0fcba67e47ff398a6fa86476d4884d472dc98a (patch)
treef8cd48d55b5668f0a8e0b22f0c17d3e9fefc9876 /arch/x86/kernel/cpu/perf_event.c
parentc1726f343b3bfc2ee037e191907c632a31903021 (diff)
perf, x86: Call x86_setup_perfctr() from .hw_config()
The perfctr setup calls are in the corresponding .hw_config() functions now. This makes it possible to introduce config functions for other pmu events that are not perfctr specific. Also, all of a sudden the code looks much nicer. Signed-off-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <1271190201-25705-4-git-send-email-robert.richter@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event.c')
-rw-r--r--arch/x86/kernel/cpu/perf_event.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 3d3bceb9e830..c2c1e10f7b03 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -505,7 +505,7 @@ static int x86_pmu_hw_config(struct perf_event *event)
if (event->attr.type == PERF_TYPE_RAW)
event->hw.config |= event->attr.config & X86_RAW_EVENT_MASK;
- return 0;
+ return x86_setup_perfctr(event);
}
/*
@@ -543,12 +543,7 @@ static int __hw_perf_event_init(struct perf_event *event)
event->hw.last_cpu = -1;
event->hw.last_tag = ~0ULL;
- /* Processor specifics */
- err = x86_pmu.hw_config(event);
- if (err)
- return err;
-
- return x86_setup_perfctr(event);
+ return x86_pmu.hw_config(event);
}
static void x86_pmu_disable_all(void)