Commit a90738c2 authored by Stephane Eranian's avatar Stephane Eranian Committed by Ingo Molnar

perf/x86/intel: Fix intel_get_event_constraints() for dynamic constraints

With dynamic constraint, we need to restart from the static
constraints each time the intel_get_event_constraints() is called.
Signed-off-by: default avatarStephane Eranian <eranian@google.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarMaria Dimakopoulou <maria.n.dimakopoulou@gmail.com>
Cc: bp@alien8.de
Cc: jolsa@redhat.com
Cc: kan.liang@intel.com
Link: http://lkml.kernel.org/r/1416251225-17721-10-git-send-email-eranian@google.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent b63b4b45
...@@ -2063,20 +2063,25 @@ static struct event_constraint * ...@@ -2063,20 +2063,25 @@ static struct event_constraint *
intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx, intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
struct perf_event *event) struct perf_event *event)
{ {
struct event_constraint *c = event->hw.constraint; struct event_constraint *c1 = event->hw.constraint;
struct event_constraint *c2;
/* /*
* first time only * first time only
* - static constraint: no change across incremental scheduling calls * - static constraint: no change across incremental scheduling calls
* - dynamic constraint: handled by intel_get_excl_constraints() * - dynamic constraint: handled by intel_get_excl_constraints()
*/ */
if (!c) c2 = __intel_get_event_constraints(cpuc, idx, event);
c = __intel_get_event_constraints(cpuc, idx, event); if (c1 && (c1->flags & PERF_X86_EVENT_DYNAMIC)) {
bitmap_copy(c1->idxmsk, c2->idxmsk, X86_PMC_IDX_MAX);
c1->weight = c2->weight;
c2 = c1;
}
if (cpuc->excl_cntrs) if (cpuc->excl_cntrs)
return intel_get_excl_constraints(cpuc, event, idx, c); return intel_get_excl_constraints(cpuc, event, idx, c2);
return c; return c2;
} }
static void intel_put_excl_constraints(struct cpu_hw_events *cpuc, static void intel_put_excl_constraints(struct cpu_hw_events *cpuc,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment