Skip to content

Commit

Permalink
perf, x86: Report error code that returned from x86_pmu.hw_config()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Richter authored and Ingo Molnar committed Mar 17, 2010
1 parent 5cc718b commit 984763c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,9 @@ static int __hw_perf_event_init(struct perf_event *event)
hwc->last_tag = ~0ULL;

/* Processor specifics */
if (x86_pmu.hw_config(attr, hwc))
return -EOPNOTSUPP;
err = x86_pmu.hw_config(attr, hwc);
if (err)
return err;

if (!hwc->sample_period) {
hwc->sample_period = x86_pmu.max_period;
Expand Down

0 comments on commit 984763c

Please sign in to comment.