|
@@ -1058,6 +1058,12 @@ static int armv7pmu_get_event_idx(struct pmu_hw_events *cpuc,
|
|
|
return -EAGAIN;
|
|
|
}
|
|
|
|
|
|
+static void armv7pmu_clear_event_idx(struct pmu_hw_events *cpuc,
|
|
|
+ struct perf_event *event)
|
|
|
+{
|
|
|
+ clear_bit(event->hw.idx, cpuc->used_mask);
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* Add an event filter to a given event. This will only work for PMUv2 PMUs.
|
|
|
*/
|
|
@@ -1167,6 +1173,7 @@ static void armv7pmu_init(struct arm_pmu *cpu_pmu)
|
|
|
cpu_pmu->read_counter = armv7pmu_read_counter;
|
|
|
cpu_pmu->write_counter = armv7pmu_write_counter;
|
|
|
cpu_pmu->get_event_idx = armv7pmu_get_event_idx;
|
|
|
+ cpu_pmu->clear_event_idx = armv7pmu_clear_event_idx;
|
|
|
cpu_pmu->start = armv7pmu_start;
|
|
|
cpu_pmu->stop = armv7pmu_stop;
|
|
|
cpu_pmu->reset = armv7pmu_reset;
|
|
@@ -1637,6 +1644,7 @@ static void krait_pmu_clear_event_idx(struct pmu_hw_events *cpuc,
|
|
|
bool venum_event = EVENT_VENUM(hwc->config_base);
|
|
|
bool krait_event = EVENT_CPU(hwc->config_base);
|
|
|
|
|
|
+ armv7pmu_clear_event_idx(cpuc, event);
|
|
|
if (venum_event || krait_event) {
|
|
|
bit = krait_event_to_bit(event, region, group);
|
|
|
clear_bit(bit, cpuc->used_mask);
|
|
@@ -1966,6 +1974,7 @@ static void scorpion_pmu_clear_event_idx(struct pmu_hw_events *cpuc,
|
|
|
bool venum_event = EVENT_VENUM(hwc->config_base);
|
|
|
bool scorpion_event = EVENT_CPU(hwc->config_base);
|
|
|
|
|
|
+ armv7pmu_clear_event_idx(cpuc, event);
|
|
|
if (venum_event || scorpion_event) {
|
|
|
bit = scorpion_event_to_bit(event, region, group);
|
|
|
clear_bit(bit, cpuc->used_mask);
|