Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312223
b: refs/heads/master
c: 70ab700
h: refs/heads/master
i:
  312221: 6a4337c
  312219: c2958df
  312215: ad09943
  312207: f33f942
  312191: 8a56910
v: v3
  • Loading branch information
Andi Kleen authored and Ingo Molnar committed Jun 6, 2012
1 parent 58c2343 commit 7292a68
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 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: c48b60538c3ba05a7a2713c4791b25405525431b
refs/heads/master: 70ab7003dec58afeae7f5d681dfa309b3a259f03
3 changes: 2 additions & 1 deletion trunk/arch/x86/kernel/cpu/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct amd_nb {
};

/* The maximal number of PEBS events: */
#define MAX_PEBS_EVENTS 4
#define MAX_PEBS_EVENTS 8

/*
* A debug store configuration.
Expand Down Expand Up @@ -378,6 +378,7 @@ struct x86_pmu {
void (*drain_pebs)(struct pt_regs *regs);
struct event_constraint *pebs_constraints;
void (*pebs_aliases)(struct perf_event *event);
int max_pebs_events;

/*
* Intel LBR
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_event_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,8 @@ __init int intel_pmu_init(void)
x86_pmu.events_maskl = ebx.full;
x86_pmu.events_mask_len = eax.split.mask_length;

x86_pmu.max_pebs_events = min_t(unsigned, MAX_PEBS_EVENTS, x86_pmu.num_counters);

/*
* Quirk: v2 perfmon does not report fixed-purpose events, so
* assume at least 3 events:
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/x86/kernel/cpu/perf_event_intel_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs)
* Should not happen, we program the threshold at 1 and do not
* set a reset value.
*/
WARN_ON_ONCE(n > 1);
WARN_ONCE(n > 1, "bad leftover pebs %d\n", n);
at += n - 1;

__intel_pmu_pebs_event(event, iregs, at);
Expand Down Expand Up @@ -651,10 +651,10 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
* Should not happen, we program the threshold at 1 and do not
* set a reset value.
*/
WARN_ON_ONCE(n > MAX_PEBS_EVENTS);
WARN_ONCE(n > x86_pmu.max_pebs_events, "Unexpected number of pebs records %d\n", n);

for ( ; at < top; at++) {
for_each_set_bit(bit, (unsigned long *)&at->status, MAX_PEBS_EVENTS) {
for_each_set_bit(bit, (unsigned long *)&at->status, x86_pmu.max_pebs_events) {
event = cpuc->events[bit];
if (!test_bit(bit, cpuc->active_mask))
continue;
Expand All @@ -670,7 +670,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
break;
}

if (!event || bit >= MAX_PEBS_EVENTS)
if (!event || bit >= x86_pmu.max_pebs_events)
continue;

__intel_pmu_pebs_event(event, iregs, at);
Expand Down

0 comments on commit 7292a68

Please sign in to comment.