* Can only be executed on the CPU where the counter is active.
* Returns the delta events processed.
*/
-static void
+static u64
x86_perf_counter_update(struct perf_counter *counter,
struct hw_perf_counter *hwc, int idx)
{
atomic64_add(delta, &counter->count);
atomic64_sub(delta, &hwc->period_left);
+
+ return new_raw_count;
}
static atomic_t num_counters;
continue;
counter = cpuc->counters[idx];
hwc = &counter->hw;
- x86_perf_counter_update(counter, hwc, idx);
- val = atomic64_read(&hwc->prev_count);
+ val = x86_perf_counter_update(counter, hwc, idx);
if (val & (1ULL << (x86_pmu.counter_bits - 1)))
continue;
/* counter overflow */