Skip to content

Commit b6a32f0

Browse files
olsajiriIngo Molnar
authored andcommitted
perf/x86: Fix PEBS threshold initialization
Latest PEBS rework change could skip initialization of the ds->pebs_interrupt_threshold for single event PEBS threshold events. Make sure the PEBS threshold gets always initialized. Signed-off-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Fixes: 09e61b4 ("perf/x86/intel: Rework the large PEBS setup code") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent e64cd6f commit b6a32f0

File tree

1 file changed

+11
-1
lines changed
  • arch/x86/events/intel

1 file changed

+11
-1
lines changed

arch/x86/events/intel/ds.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,14 +834,24 @@ static inline void pebs_update_threshold(struct cpu_hw_events *cpuc)
834834
static void
835835
pebs_update_state(bool needed_cb, struct cpu_hw_events *cpuc, struct pmu *pmu)
836836
{
837+
/*
838+
* Make sure we get updated with the first PEBS
839+
* event. It will trigger also during removal, but
840+
* that does not hurt:
841+
*/
842+
bool update = cpuc->n_pebs == 1;
843+
837844
if (needed_cb != pebs_needs_sched_cb(cpuc)) {
838845
if (!needed_cb)
839846
perf_sched_cb_inc(pmu);
840847
else
841848
perf_sched_cb_dec(pmu);
842849

843-
pebs_update_threshold(cpuc);
850+
update = true;
844851
}
852+
853+
if (update)
854+
pebs_update_threshold(cpuc);
845855
}
846856

847857
void intel_pmu_pebs_add(struct perf_event *event)

0 commit comments

Comments
 (0)