return val;
}
-static void xe_pmu_event_read(struct perf_event *event)
+static void xe_pmu_event_update(struct perf_event *event)
{
- struct xe_device *xe = container_of(event->pmu, typeof(*xe), pmu.base);
struct hw_perf_event *hwc = &event->hw;
- struct xe_pmu *pmu = &xe->pmu;
u64 prev, new;
- if (!pmu->registered) {
- event->hw.state = PERF_HES_STOPPED;
- return;
- }
-
prev = local64_read(&hwc->prev_count);
do {
new = __xe_pmu_event_read(event);
local64_add(new - prev, &event->count);
}
+static void xe_pmu_event_read(struct perf_event *event)
+{
+ struct xe_device *xe = container_of(event->pmu, typeof(*xe), pmu.base);
+ struct xe_pmu *pmu = &xe->pmu;
+
+ if (!pmu->registered) {
+ event->hw.state = PERF_HES_STOPPED;
+ return;
+ }
+
+ xe_pmu_event_update(event);
+}
+
static void xe_pmu_enable(struct perf_event *event)
{
/*
if (pmu->registered)
if (flags & PERF_EF_UPDATE)
- xe_pmu_event_read(event);
+ xe_pmu_event_update(event);
event->hw.state = PERF_HES_STOPPED;
}