perf, x86: Fix pebs drains
I overlooked the perf_disable()/perf_enable() calls in intel_pmu_handle_irq(), (pointed out by Markus) so we should not explicitly disable_all/enable_all pebs counters in the drain functions, these are already disabled and enabling them early is confusing. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: paulus@samba.org Cc: eranian@google.com Cc: robert.richter@amd.com Cc: fweisbec@gmail.com LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
cc7f00820b
commit
8f4aebd2be
1 changed files with 3 additions and 12 deletions
|
@ -476,18 +476,16 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs)
|
||||||
if (!event || !ds || !x86_pmu.pebs)
|
if (!event || !ds || !x86_pmu.pebs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
intel_pmu_pebs_disable_all();
|
|
||||||
|
|
||||||
at = (struct pebs_record_core *)(unsigned long)ds->pebs_buffer_base;
|
at = (struct pebs_record_core *)(unsigned long)ds->pebs_buffer_base;
|
||||||
top = (struct pebs_record_core *)(unsigned long)ds->pebs_index;
|
top = (struct pebs_record_core *)(unsigned long)ds->pebs_index;
|
||||||
|
|
||||||
if (top <= at)
|
if (top <= at)
|
||||||
goto out;
|
return;
|
||||||
|
|
||||||
ds->pebs_index = ds->pebs_buffer_base;
|
ds->pebs_index = ds->pebs_buffer_base;
|
||||||
|
|
||||||
if (!intel_pmu_save_and_restart(event))
|
if (!intel_pmu_save_and_restart(event))
|
||||||
goto out;
|
return;
|
||||||
|
|
||||||
perf_sample_data_init(&data, 0);
|
perf_sample_data_init(&data, 0);
|
||||||
data.period = event->hw.last_period;
|
data.period = event->hw.last_period;
|
||||||
|
@ -528,9 +526,6 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs)
|
||||||
|
|
||||||
if (perf_event_overflow(event, 1, &data, ®s))
|
if (perf_event_overflow(event, 1, &data, ®s))
|
||||||
x86_pmu_stop(event);
|
x86_pmu_stop(event);
|
||||||
|
|
||||||
out:
|
|
||||||
intel_pmu_pebs_enable_all();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
|
static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
|
||||||
|
@ -547,13 +542,11 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
|
||||||
if (!ds || !x86_pmu.pebs)
|
if (!ds || !x86_pmu.pebs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
intel_pmu_pebs_disable_all();
|
|
||||||
|
|
||||||
at = (struct pebs_record_nhm *)(unsigned long)ds->pebs_buffer_base;
|
at = (struct pebs_record_nhm *)(unsigned long)ds->pebs_buffer_base;
|
||||||
top = (struct pebs_record_nhm *)(unsigned long)ds->pebs_index;
|
top = (struct pebs_record_nhm *)(unsigned long)ds->pebs_index;
|
||||||
|
|
||||||
if (top <= at)
|
if (top <= at)
|
||||||
goto out;
|
return;
|
||||||
|
|
||||||
ds->pebs_index = ds->pebs_buffer_base;
|
ds->pebs_index = ds->pebs_buffer_base;
|
||||||
|
|
||||||
|
@ -604,8 +597,6 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
|
||||||
if (perf_event_overflow(event, 1, &data, ®s))
|
if (perf_event_overflow(event, 1, &data, ®s))
|
||||||
x86_pmu_stop(event);
|
x86_pmu_stop(event);
|
||||||
}
|
}
|
||||||
out:
|
|
||||||
intel_pmu_pebs_enable_all();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue