Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147510
b: refs/heads/master
c: 79202ba
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed May 26, 2009
1 parent 45da29d commit 04746e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 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: 8a7b8cb91f26a671f22cedc7fd54508667f2d9b9
refs/heads/master: 79202ba9ff8cf570a75596f42e011167734d1c4b
16 changes: 3 additions & 13 deletions trunk/arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,10 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
hwc->config |= ARCH_PERFMON_EVENTSEL_OS;

/*
* If privileged enough, allow NMI events:
* Use NMI events all the time:
*/
hwc->nmi = 0;
if (hw_event->nmi) {
if (sysctl_perf_counter_priv && !capable(CAP_SYS_ADMIN))
return -EACCES;
hwc->nmi = 1;
}
hwc->nmi = 1;
hw_event->nmi = 1;

if (!hwc->irq_period)
hwc->irq_period = x86_pmu.max_period;
Expand Down Expand Up @@ -553,9 +549,6 @@ fixed_mode_idx(struct perf_counter *counter, struct hw_perf_counter *hwc)
if (!x86_pmu.num_counters_fixed)
return -1;

if (unlikely(hwc->nmi))
return -1;

event = hwc->config & ARCH_PERFMON_EVENT_MASK;

if (unlikely(event == x86_pmu.event_map(PERF_COUNT_INSTRUCTIONS)))
Expand Down Expand Up @@ -806,9 +799,6 @@ static int amd_pmu_handle_irq(struct pt_regs *regs, int nmi)
counter = cpuc->counters[idx];
hwc = &counter->hw;

if (counter->hw_event.nmi != nmi)
continue;

val = x86_perf_counter_update(counter, hwc, idx);
if (val & (1ULL << (x86_pmu.counter_bits - 1)))
continue;
Expand Down

0 comments on commit 04746e7

Please sign in to comment.