Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270127
b: refs/heads/master
c: c47f868
h: refs/heads/master
i:
  270125: ee7d0da
  270123: f637eba
  270119: 11542e4
  270111: 4b5fe2f
v: v3
  • Loading branch information
Mark Rutland authored and Will Deacon committed Aug 31, 2011
1 parent 8bb5722 commit efcbb67
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 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: 7b9f72c62ed047a200b1ef8c70bee0b58e880af8
refs/heads/master: c47f8684baefa2bf52c4320f894e73db08dc8a0a
8 changes: 0 additions & 8 deletions trunk/arch/arm/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ struct cpu_hw_events {
* an event. A 0 means that the counter can be used.
*/
unsigned long used_mask[BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)];

/*
* A 1 bit for an index indicates that the counter is actively being
* used.
*/
unsigned long active_mask[BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)];
};
static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events);

Expand Down Expand Up @@ -295,7 +289,6 @@ armpmu_del(struct perf_event *event, int flags)

WARN_ON(idx < 0);

clear_bit(idx, cpuc->active_mask);
armpmu_stop(event, PERF_EF_UPDATE);
cpuc->events[idx] = NULL;
clear_bit(idx, cpuc->used_mask);
Expand Down Expand Up @@ -327,7 +320,6 @@ armpmu_add(struct perf_event *event, int flags)
event->hw.idx = idx;
armpmu->disable(hwc, idx);
cpuc->events[idx] = event;
set_bit(idx, cpuc->active_mask);

hwc->state = PERF_HES_STOPPED | PERF_HES_UPTODATE;
if (flags & PERF_EF_START)
Expand Down
19 changes: 18 additions & 1 deletion trunk/arch/arm/kernel/perf_event_v6.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,23 @@ armv6pmu_enable_event(struct hw_perf_event *hwc,
raw_spin_unlock_irqrestore(&pmu_lock, flags);
}

static int counter_is_active(unsigned long pmcr, int idx)
{
unsigned long mask = 0;
if (idx == ARMV6_CYCLE_COUNTER)
mask = ARMV6_PMCR_CCOUNT_IEN;
else if (idx == ARMV6_COUNTER0)
mask = ARMV6_PMCR_COUNT0_IEN;
else if (idx == ARMV6_COUNTER1)
mask = ARMV6_PMCR_COUNT1_IEN;

if (mask)
return pmcr & mask;

WARN_ONCE(1, "invalid counter number (%d)\n", idx);
return 0;
}

static irqreturn_t
armv6pmu_handle_irq(int irq_num,
void *dev)
Expand Down Expand Up @@ -491,7 +508,7 @@ armv6pmu_handle_irq(int irq_num,
struct perf_event *event = cpuc->events[idx];
struct hw_perf_event *hwc;

if (!test_bit(idx, cpuc->active_mask))
if (!counter_is_active(pmcr, idx))
continue;

/*
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/arm/kernel/perf_event_v7.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,9 +1022,6 @@ static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)
struct perf_event *event = cpuc->events[idx];
struct hw_perf_event *hwc;

if (!test_bit(idx, cpuc->active_mask))
continue;

/*
* We have a single interrupt for all counters. Check that
* each counter has overflowed before we process it.
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/arm/kernel/perf_event_xscale.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,6 @@ xscale1pmu_handle_irq(int irq_num, void *dev)
struct perf_event *event = cpuc->events[idx];
struct hw_perf_event *hwc;

if (!test_bit(idx, cpuc->active_mask))
continue;

if (!xscale1_pmnc_counter_has_overflowed(pmnc, idx))
continue;

Expand Down Expand Up @@ -585,9 +582,6 @@ xscale2pmu_handle_irq(int irq_num, void *dev)
struct perf_event *event = cpuc->events[idx];
struct hw_perf_event *hwc;

if (!test_bit(idx, cpuc->active_mask))
continue;

if (!xscale2_pmnc_counter_has_overflowed(pmnc, idx))
continue;

Expand Down

0 comments on commit efcbb67

Please sign in to comment.