Lines Matching full:event
3 * HiSilicon SoC Hardware event counters support
41 * PMU event attributes
66 static bool hisi_validate_event_group(struct perf_event *event) in hisi_validate_event_group() argument
68 struct perf_event *sibling, *leader = event->group_leader; in hisi_validate_event_group()
69 struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu); in hisi_validate_event_group()
70 /* Include count for the event */ in hisi_validate_event_group()
78 if (leader->pmu != event->pmu) in hisi_validate_event_group()
82 if (leader != event) in hisi_validate_event_group()
86 for_each_sibling_event(sibling, event->group_leader) { in hisi_validate_event_group()
89 if (sibling->pmu != event->pmu) in hisi_validate_event_group()
105 int hisi_uncore_pmu_get_event_idx(struct perf_event *event) in hisi_uncore_pmu_get_event_idx() argument
107 struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu); in hisi_uncore_pmu_get_event_idx()
125 dev_err(hisi_pmu->dev, "Unsupported event index:%d!\n", idx); in hisi_uncore_pmu_clear_event_idx()
132 int hisi_uncore_pmu_event_init(struct perf_event *event) in hisi_uncore_pmu_event_init() argument
134 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_event_init()
137 if (event->attr.type != event->pmu->type) in hisi_uncore_pmu_event_init()
145 if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK) in hisi_uncore_pmu_event_init()
152 if (event->cpu < 0) in hisi_uncore_pmu_event_init()
159 if (!hisi_validate_event_group(event)) in hisi_uncore_pmu_event_init()
162 hisi_pmu = to_hisi_pmu(event->pmu); in hisi_uncore_pmu_event_init()
163 if (event->attr.config > hisi_pmu->check_event) in hisi_uncore_pmu_event_init()
169 * We don't assign an index until we actually place the event onto in hisi_uncore_pmu_event_init()
174 hwc->config_base = event->attr.config; in hisi_uncore_pmu_event_init()
177 event->cpu = hisi_pmu->on_cpu; in hisi_uncore_pmu_event_init()
184 * Set the counter to count the event that we're interested in,
187 static void hisi_uncore_pmu_enable_event(struct perf_event *event) in hisi_uncore_pmu_enable_event() argument
189 struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu); in hisi_uncore_pmu_enable_event()
190 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_enable_event()
193 HISI_GET_EVENTID(event)); in hisi_uncore_pmu_enable_event()
202 static void hisi_uncore_pmu_disable_event(struct perf_event *event) in hisi_uncore_pmu_disable_event() argument
204 struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu); in hisi_uncore_pmu_disable_event()
205 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_disable_event()
211 void hisi_uncore_pmu_set_event_period(struct perf_event *event) in hisi_uncore_pmu_set_event_period() argument
213 struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu); in hisi_uncore_pmu_set_event_period()
214 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_set_event_period()
226 /* Write start value to the hardware event counter */ in hisi_uncore_pmu_set_event_period()
231 void hisi_uncore_pmu_event_update(struct perf_event *event) in hisi_uncore_pmu_event_update() argument
233 struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu); in hisi_uncore_pmu_event_update()
234 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_event_update()
248 local64_add(delta, &event->count); in hisi_uncore_pmu_event_update()
252 void hisi_uncore_pmu_start(struct perf_event *event, int flags) in hisi_uncore_pmu_start() argument
254 struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu); in hisi_uncore_pmu_start()
255 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_start()
262 hisi_uncore_pmu_set_event_period(event); in hisi_uncore_pmu_start()
270 hisi_uncore_pmu_enable_event(event); in hisi_uncore_pmu_start()
271 perf_event_update_userpage(event); in hisi_uncore_pmu_start()
275 void hisi_uncore_pmu_stop(struct perf_event *event, int flags) in hisi_uncore_pmu_stop() argument
277 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_stop()
279 hisi_uncore_pmu_disable_event(event); in hisi_uncore_pmu_stop()
287 hisi_uncore_pmu_event_update(event); in hisi_uncore_pmu_stop()
292 int hisi_uncore_pmu_add(struct perf_event *event, int flags) in hisi_uncore_pmu_add() argument
294 struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu); in hisi_uncore_pmu_add()
295 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_add()
301 idx = hisi_pmu->ops->get_event_idx(event); in hisi_uncore_pmu_add()
305 event->hw.idx = idx; in hisi_uncore_pmu_add()
306 hisi_pmu->pmu_events.hw_events[idx] = event; in hisi_uncore_pmu_add()
309 hisi_uncore_pmu_start(event, PERF_EF_RELOAD); in hisi_uncore_pmu_add()
315 void hisi_uncore_pmu_del(struct perf_event *event, int flags) in hisi_uncore_pmu_del() argument
317 struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu); in hisi_uncore_pmu_del()
318 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_del()
320 hisi_uncore_pmu_stop(event, PERF_EF_UPDATE); in hisi_uncore_pmu_del()
322 perf_event_update_userpage(event); in hisi_uncore_pmu_del()
327 void hisi_uncore_pmu_read(struct perf_event *event) in hisi_uncore_pmu_read() argument
330 hisi_uncore_pmu_event_update(event); in hisi_uncore_pmu_read()
428 /* Use this CPU in cpumask for event counting */ in hisi_uncore_pmu_online_cpu()
463 /* Use this CPU for event counting */ in hisi_uncore_pmu_offline_cpu()