提交 984763cb 编写于 作者: R Robert Richter 提交者: Ingo Molnar

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: NRobert Richter <robert.richter@amd.com>
Acked-by: NCyrill Gorcunov <gorcunov@gmail.com>
Acked-by: NLin 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: NIngo Molnar <mingo@elte.hu>
上级 5cc718b9
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册