Lines Matching refs:event

103 static void arc_perf_event_update(struct perf_event *event,  in arc_perf_event_update()  argument
115 local64_add(delta, &event->count); in arc_perf_event_update()
119 static void arc_pmu_read(struct perf_event *event) in arc_pmu_read() argument
121 arc_perf_event_update(event, &event->hw, event->hw.idx); in arc_pmu_read()
152 static int arc_pmu_event_init(struct perf_event *event) in arc_pmu_event_init() argument
154 struct hw_perf_event *hwc = &event->hw; in arc_pmu_event_init()
157 if (!is_sampling_event(event)) { in arc_pmu_event_init()
167 if (event->attr.exclude_user) in arc_pmu_event_init()
171 if (event->attr.exclude_kernel) in arc_pmu_event_init()
175 switch (event->attr.type) { in arc_pmu_event_init()
177 if (event->attr.config >= PERF_COUNT_HW_MAX) in arc_pmu_event_init()
179 if (arc_pmu->ev_hw_idx[event->attr.config] < 0) 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()
184 arc_pmu_ev_hw_map[event->attr.config]); in arc_pmu_event_init()
188 ret = arc_pmu_cache_event(event->attr.config); in arc_pmu_event_init()
214 static int arc_pmu_event_set_period(struct perf_event *event) in arc_pmu_event_set_period() argument
216 struct hw_perf_event *hwc = &event->hw; in arc_pmu_event_set_period()
250 perf_event_update_userpage(event); in arc_pmu_event_set_period()
260 static void arc_pmu_start(struct perf_event *event, int flags) in arc_pmu_start() argument
262 struct hw_perf_event *hwc = &event->hw; in arc_pmu_start()
273 arc_pmu_event_set_period(event); in arc_pmu_start()
276 if (is_sampling_event(event)) in arc_pmu_start()
285 static void arc_pmu_stop(struct perf_event *event, int flags) in arc_pmu_stop() argument
287 struct hw_perf_event *hwc = &event->hw; in arc_pmu_stop()
291 if (is_sampling_event(event)) { in arc_pmu_stop()
301 if (!(event->hw.state & PERF_HES_STOPPED)) { in arc_pmu_stop()
308 event->hw.state |= PERF_HES_STOPPED; in arc_pmu_stop()
312 !(event->hw.state & PERF_HES_UPTODATE)) { in arc_pmu_stop()
313 arc_perf_event_update(event, &event->hw, idx); in arc_pmu_stop()
314 event->hw.state |= PERF_HES_UPTODATE; in arc_pmu_stop()
318 static void arc_pmu_del(struct perf_event *event, int flags) in arc_pmu_del() argument
322 arc_pmu_stop(event, PERF_EF_UPDATE); in arc_pmu_del()
323 __clear_bit(event->hw.idx, pmu_cpu->used_mask); in arc_pmu_del()
325 pmu_cpu->act_counter[event->hw.idx] = 0; in arc_pmu_del()
327 perf_event_update_userpage(event); in arc_pmu_del()
331 static int arc_pmu_add(struct perf_event *event, int flags) in arc_pmu_add() argument
334 struct hw_perf_event *hwc = &event->hw; in arc_pmu_add()
349 pmu_cpu->act_counter[idx] = event; in arc_pmu_add()
351 if (is_sampling_event(event)) { in arc_pmu_add()
365 arc_pmu_start(event, PERF_EF_RELOAD); in arc_pmu_add()
367 perf_event_update_userpage(event); in arc_pmu_add()
388 struct perf_event *event = pmu_cpu->act_counter[idx]; in arc_pmu_intr() local
405 hwc = &event->hw; in arc_pmu_intr()
409 arc_perf_event_update(event, &event->hw, event->hw.idx); in arc_pmu_intr()
411 if (!arc_pmu_event_set_period(event)) in arc_pmu_intr()
414 if (perf_event_overflow(event, &data, regs)) in arc_pmu_intr()
415 arc_pmu_stop(event, 0); in arc_pmu_intr()