Lines Matching refs:hwc
104 struct hw_perf_event *hwc, int idx) in arc_perf_event_update() argument
106 uint64_t prev_raw_count = local64_read(&hwc->prev_count); in arc_perf_event_update()
114 local64_set(&hwc->prev_count, new_raw_count); in arc_perf_event_update()
116 local64_sub(delta, &hwc->period_left); in arc_perf_event_update()
154 struct hw_perf_event *hwc = &event->hw; in arc_pmu_event_init() local
158 hwc->sample_period = arc_pmu->max_period; in arc_pmu_event_init()
159 hwc->last_period = hwc->sample_period; in arc_pmu_event_init()
160 local64_set(&hwc->period_left, hwc->sample_period); in arc_pmu_event_init()
163 hwc->config = 0; in arc_pmu_event_init()
168 hwc->config |= ARC_REG_PCT_CONFIG_KERN; in arc_pmu_event_init()
172 hwc->config |= ARC_REG_PCT_CONFIG_USER; in arc_pmu_event_init()
181 hwc->config |= arc_pmu->ev_hw_idx[event->attr.config]; in arc_pmu_event_init()
183 (int)event->attr.config, (int)hwc->config, in arc_pmu_event_init()
191 hwc->config |= arc_pmu->ev_hw_idx[ret]; in arc_pmu_event_init()
193 (int)hwc->config, arc_pmu_ev_hw_map[ret]); in arc_pmu_event_init()
218 struct hw_perf_event *hwc = &event->hw; in arc_pmu_event_set_period() local
219 s64 left = local64_read(&hwc->period_left); in arc_pmu_event_set_period()
220 s64 period = hwc->sample_period; in arc_pmu_event_set_period()
221 int idx = hwc->idx; in arc_pmu_event_set_period()
228 local64_set(&hwc->period_left, left); in arc_pmu_event_set_period()
229 hwc->last_period = period; in arc_pmu_event_set_period()
234 local64_set(&hwc->period_left, left); in arc_pmu_event_set_period()
235 hwc->last_period = period; in arc_pmu_event_set_period()
243 local64_set(&hwc->prev_count, value); in arc_pmu_event_set_period()
264 struct hw_perf_event *hwc = &event->hw; in arc_pmu_start() local
265 int idx = hwc->idx; in arc_pmu_start()
271 WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE)); in arc_pmu_start()
273 hwc->state = 0; in arc_pmu_start()
284 write_aux_reg(ARC_REG_PCT_CONFIG, hwc->config); /* condition */ in arc_pmu_start()
289 struct hw_perf_event *hwc = &event->hw; in arc_pmu_stop() local
290 int idx = hwc->idx; in arc_pmu_stop()
336 struct hw_perf_event *hwc = &event->hw; in arc_pmu_add() local
337 int idx = hwc->idx; in arc_pmu_add()
344 hwc->idx = idx; in arc_pmu_add()
360 local64_set(&hwc->prev_count, 0); in arc_pmu_add()
362 hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED; in arc_pmu_add()
390 struct hw_perf_event *hwc; in arc_pmu_intr() local
406 hwc = &event->hw; in arc_pmu_intr()
408 WARN_ON_ONCE(hwc->idx != idx); in arc_pmu_intr()
411 perf_sample_data_init(&data, 0, hwc->last_period); in arc_pmu_intr()