aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2010-03-16 12:07:33 -0400
committerIngo Molnar <mingo@elte.hu>2010-03-17 05:43:50 -0400
commit984763cb90d4b5444baa0c3e43feff7926bf1834 (patch)
tree460a558feaff3b1530a49086c0ef1444e305b10d /arch/x86/kernel
parent5cc718b9dad682329a60e73547c6e708faa5bbe4 (diff)
perf, x86: Report error code that returned from x86_pmu.hw_config()
If x86_pmu.hw_config() fails a fixed error code (-EOPNOTSUPP) is returned even if a different error was reported. This patch fixes this. Signed-off-by: Robert Richter <robert.richter@amd.com> Acked-by: Cyrill Gorcunov <gorcunov@gmail.com> Acked-by: Lin Ming <ming.m.lin@intel.com> Cc: acme@redhat.com Cc: eranian@google.com Cc: gorcunov@openvz.org Cc: peterz@infradead.org Cc: fweisbec@gmail.com LKML-Reference: <20100316160733.GR1585@erda.amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/cpu/perf_event.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 0d3466cf7f57..5dacf63f913e 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -472,8 +472,9 @@ static int __hw_perf_event_init(struct perf_event *event)
472 hwc->last_tag = ~0ULL; 472 hwc->last_tag = ~0ULL;
473 473
474 /* Processor specifics */ 474 /* Processor specifics */
475 if (x86_pmu.hw_config(attr, hwc)) 475 err = x86_pmu.hw_config(attr, hwc);
476 return -EOPNOTSUPP; 476 if (err)
477 return err;
477 478
478 if (!hwc->sample_period) { 479 if (!hwc->sample_period) {
479 hwc->sample_period = x86_pmu.max_period; 480 hwc->sample_period = x86_pmu.max_period;