Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191069
b: refs/heads/master
c: d80c750
h: refs/heads/master
i:
  191067: c44671f
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Mar 10, 2010
1 parent 38e2fd0 commit d7c845e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7645a24cbd01cbf4865d1273d5ddaa8d8c2ccb3a
refs/heads/master: d80c7502ff63aa0d99d8c0c5803d28bbef67a74e
38 changes: 24 additions & 14 deletions trunk/arch/x86/kernel/cpu/perf_event_intel_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,20 +472,39 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs)
struct pt_regs regs;
int n;

if (!event || !ds || !x86_pmu.pebs)
if (!ds || !x86_pmu.pebs)
return;

at = (struct pebs_record_core *)(unsigned long)ds->pebs_buffer_base;
top = (struct pebs_record_core *)(unsigned long)ds->pebs_index;

if (top <= at)
/*
* Whatever else happens, drain the thing
*/
ds->pebs_index = ds->pebs_buffer_base;

if (!test_bit(0, cpuc->active_mask))
return;

ds->pebs_index = ds->pebs_buffer_base;
WARN_ON_ONCE(!event);

if (!event->attr.precise)
return;

n = top - at;
if (n <= 0)
return;

if (!intel_pmu_save_and_restart(event))
return;

/*
* Should not happen, we program the threshold at 1 and do not
* set a reset value.
*/
WARN_ON_ONCE(n > 1);
at += n - 1;

perf_sample_data_init(&data, 0);
data.period = event->hw.last_period;

Expand All @@ -495,14 +514,6 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs)
data.raw = &raw;
}

n = top - at;

/*
* Should not happen, we program the threshold at 1 and do not
* set a reset value.
*/
WARN_ON_ONCE(n > 1);

/*
* We use the interrupt regs as a base because the PEBS record
* does not contain a full regs set, specifically it seems to
Expand Down Expand Up @@ -545,12 +556,11 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
at = (struct pebs_record_nhm *)(unsigned long)ds->pebs_buffer_base;
top = (struct pebs_record_nhm *)(unsigned long)ds->pebs_index;

if (top <= at)
return;

ds->pebs_index = ds->pebs_buffer_base;

n = top - at;
if (n <= 0)
return;

/*
* Should not happen, we program the threshold at 1 and do not
Expand Down

0 comments on commit d7c845e

Please sign in to comment.