Lines Matching refs:hwc
146 struct hw_perf_event *hwc, int idx) in xtensa_perf_event_update() argument
152 prev_raw_count = local64_read(&hwc->prev_count); in xtensa_perf_event_update()
154 } while (local64_cmpxchg(&hwc->prev_count, prev_raw_count, in xtensa_perf_event_update()
160 local64_sub(delta, &hwc->period_left); in xtensa_perf_event_update()
164 struct hw_perf_event *hwc, int idx) in xtensa_perf_event_set_period() argument
172 s64 period = hwc->sample_period; in xtensa_perf_event_set_period()
174 left = local64_read(&hwc->period_left); in xtensa_perf_event_set_period()
177 local64_set(&hwc->period_left, left); in xtensa_perf_event_set_period()
178 hwc->last_period = period; in xtensa_perf_event_set_period()
182 local64_set(&hwc->period_left, left); in xtensa_perf_event_set_period()
183 hwc->last_period = period; in xtensa_perf_event_set_period()
190 local64_set(&hwc->prev_count, -left); in xtensa_perf_event_set_period()
251 struct hw_perf_event *hwc = &event->hw; in xtensa_pmu_start() local
252 int idx = hwc->idx; in xtensa_pmu_start()
259 xtensa_perf_event_set_period(event, hwc, idx); in xtensa_pmu_start()
262 hwc->state = 0; in xtensa_pmu_start()
264 set_er(hwc->config, XTENSA_PMU_PMCTRL(idx)); in xtensa_pmu_start()
269 struct hw_perf_event *hwc = &event->hw; in xtensa_pmu_stop() local
270 int idx = hwc->idx; in xtensa_pmu_stop()
272 if (!(hwc->state & PERF_HES_STOPPED)) { in xtensa_pmu_stop()
276 hwc->state |= PERF_HES_STOPPED; in xtensa_pmu_stop()
293 struct hw_perf_event *hwc = &event->hw; in xtensa_pmu_add() local
294 int idx = hwc->idx; in xtensa_pmu_add()
303 hwc->idx = idx; in xtensa_pmu_add()
307 hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED; in xtensa_pmu_add()
377 struct hw_perf_event *hwc = &event->hw; in xtensa_pmu_irq_handler() local
384 xtensa_perf_event_update(event, hwc, i); in xtensa_pmu_irq_handler()
385 last_period = hwc->last_period; in xtensa_pmu_irq_handler()
386 if (xtensa_perf_event_set_period(event, hwc, i)) { in xtensa_pmu_irq_handler()