aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2014-11-17 14:07:01 -0500
committerIngo Molnar <mingo@kernel.org>2015-04-02 11:33:14 -0400
commita90738c2cb0dceb882e0d7f7f9141e0062809b4d (patch)
tree1c33d912569bd30396ef7c9b91cc80e35792177a /arch/x86
parentb63b4b459a78a9a45ea47a4803b8d1868e9d17d5 (diff)
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: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Maria 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.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index 9350de0f5407..4773ae0b52d0 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -2063,20 +2063,25 @@ static struct event_constraint *
2063intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx, 2063intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
2064 struct perf_event *event) 2064 struct perf_event *event)
2065{ 2065{
2066 struct event_constraint *c = event->hw.constraint; 2066 struct event_constraint *c1 = event->hw.constraint;
2067 struct event_constraint *c2;
2067 2068
2068 /* 2069 /*
2069 * first time only 2070 * first time only
2070 * - static constraint: no change across incremental scheduling calls 2071 * - static constraint: no change across incremental scheduling calls
2071 * - dynamic constraint: handled by intel_get_excl_constraints() 2072 * - dynamic constraint: handled by intel_get_excl_constraints()
2072 */ 2073 */
2073 if (!c) 2074 c2 = __intel_get_event_constraints(cpuc, idx, event);
2074 c = __intel_get_event_constraints(cpuc, idx, event); 2075 if (c1 && (c1->flags & PERF_X86_EVENT_DYNAMIC)) {
2076 bitmap_copy(c1->idxmsk, c2->idxmsk, X86_PMC_IDX_MAX);
2077 c1->weight = c2->weight;
2078 c2 = c1;
2079 }
2075 2080
2076 if (cpuc->excl_cntrs) 2081 if (cpuc->excl_cntrs)
2077 return intel_get_excl_constraints(cpuc, event, idx, c); 2082 return intel_get_excl_constraints(cpuc, event, idx, c2);
2078 2083
2079 return c; 2084 return c2;
2080} 2085}
2081 2086
2082static void intel_put_excl_constraints(struct cpu_hw_events *cpuc, 2087static void intel_put_excl_constraints(struct cpu_hw_events *cpuc,