Lines Matching refs:event

111 	void (*init_cntr_base)(struct perf_event *event,
113 void (*stop_event)(struct perf_event *event);
114 void (*start_event)(struct perf_event *event, int flags);
137 TX2_PMU_FORMAT_ATTR(event, event, "config:0-4");
138 TX2_PMU_FORMAT_ATTR(event_ccpi2, event, "config:0-9");
322 static void init_cntr_base_l3c(struct perf_event *event, in init_cntr_base_l3c() argument
325 struct hw_perf_event *hwc = &event->hw; in init_cntr_base_l3c()
328 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in init_cntr_base_l3c()
333 + L3C_COUNTER_CTL + (8 * GET_COUNTERID(event, cmask)); in init_cntr_base_l3c()
335 + L3C_COUNTER_DATA + (8 * GET_COUNTERID(event, cmask)); in init_cntr_base_l3c()
338 static void init_cntr_base_dmc(struct perf_event *event, in init_cntr_base_dmc() argument
341 struct hw_perf_event *hwc = &event->hw; in init_cntr_base_dmc()
344 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in init_cntr_base_dmc()
351 + DMC_COUNTER_DATA + (0xc * GET_COUNTERID(event, cmask)); in init_cntr_base_dmc()
354 static void init_cntr_base_ccpi2(struct perf_event *event, in init_cntr_base_ccpi2() argument
357 struct hw_perf_event *hwc = &event->hw; in init_cntr_base_ccpi2()
363 + CCPI2_COUNTER_CTL + (4 * GET_COUNTERID(event, cmask)); in init_cntr_base_ccpi2()
367 static void uncore_start_event_l3c(struct perf_event *event, int flags) in uncore_start_event_l3c() argument
370 struct hw_perf_event *hwc = &event->hw; in uncore_start_event_l3c()
373 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in uncore_start_event_l3c()
377 val = GET_EVENTID(event, emask) << 3; in uncore_start_event_l3c()
383 static inline void uncore_stop_event_l3c(struct perf_event *event) in uncore_stop_event_l3c() argument
385 reg_writel(0, event->hw.config_base); in uncore_stop_event_l3c()
388 static void uncore_start_event_dmc(struct perf_event *event, int flags) in uncore_start_event_dmc() argument
391 struct hw_perf_event *hwc = &event->hw; in uncore_start_event_dmc()
395 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in uncore_start_event_dmc()
399 idx = GET_COUNTERID(event, cmask); in uncore_start_event_dmc()
400 event_id = GET_EVENTID(event, emask); in uncore_start_event_dmc()
413 static void uncore_stop_event_dmc(struct perf_event *event) in uncore_stop_event_dmc() argument
416 struct hw_perf_event *hwc = &event->hw; in uncore_stop_event_dmc()
420 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in uncore_stop_event_dmc()
422 idx = GET_COUNTERID(event, cmask); in uncore_stop_event_dmc()
430 static void uncore_start_event_ccpi2(struct perf_event *event, int flags) in uncore_start_event_ccpi2() argument
433 struct hw_perf_event *hwc = &event->hw; in uncore_start_event_ccpi2()
436 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in uncore_start_event_ccpi2()
445 GET_EVENTID(event, emask)), hwc->config_base); in uncore_start_event_ccpi2()
452 local64_set(&event->hw.prev_count, 0ULL); in uncore_start_event_ccpi2()
455 static void uncore_stop_event_ccpi2(struct perf_event *event) in uncore_stop_event_ccpi2() argument
457 struct hw_perf_event *hwc = &event->hw; in uncore_stop_event_ccpi2()
463 static void tx2_uncore_event_update(struct perf_event *event) in tx2_uncore_event_update() argument
466 struct hw_perf_event *hwc = &event->hw; in tx2_uncore_event_update()
472 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in tx2_uncore_event_update()
479 GET_COUNTERID(event, cmask), in tx2_uncore_event_update()
495 GET_EVENTID(event, emask) == DMC_EVENT_DATA_TRANSFERS) in tx2_uncore_event_update()
502 local64_add(delta * prorate_factor, &event->count); in tx2_uncore_event_update()
523 struct perf_event *event, int *counters) in tx2_uncore_validate_event() argument
525 if (is_software_event(event)) in tx2_uncore_validate_event()
528 if (event->pmu != pmu) in tx2_uncore_validate_event()
539 static bool tx2_uncore_validate_event_group(struct perf_event *event, in tx2_uncore_validate_event_group() argument
542 struct perf_event *sibling, *leader = event->group_leader; in tx2_uncore_validate_event_group()
545 if (event->group_leader == event) in tx2_uncore_validate_event_group()
548 if (!tx2_uncore_validate_event(event->pmu, leader, &counters)) in tx2_uncore_validate_event_group()
552 if (!tx2_uncore_validate_event(event->pmu, sibling, &counters)) in tx2_uncore_validate_event_group()
556 if (!tx2_uncore_validate_event(event->pmu, event, &counters)) in tx2_uncore_validate_event_group()
567 static int tx2_uncore_event_init(struct perf_event *event) in tx2_uncore_event_init() argument
569 struct hw_perf_event *hwc = &event->hw; in tx2_uncore_event_init()
573 if (event->attr.type != event->pmu->type) in tx2_uncore_event_init()
581 if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK) in tx2_uncore_event_init()
584 if (event->cpu < 0) in tx2_uncore_event_init()
587 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in tx2_uncore_event_init()
590 event->cpu = tx2_pmu->cpu; in tx2_uncore_event_init()
592 if (event->attr.config >= tx2_pmu->max_events) in tx2_uncore_event_init()
596 hwc->config = event->attr.config; in tx2_uncore_event_init()
599 if (!tx2_uncore_validate_event_group(event, tx2_pmu->max_counters)) in tx2_uncore_event_init()
605 static void tx2_uncore_event_start(struct perf_event *event, int flags) in tx2_uncore_event_start() argument
607 struct hw_perf_event *hwc = &event->hw; in tx2_uncore_event_start()
611 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in tx2_uncore_event_start()
613 tx2_pmu->start_event(event, flags); in tx2_uncore_event_start()
614 perf_event_update_userpage(event); in tx2_uncore_event_start()
629 static void tx2_uncore_event_stop(struct perf_event *event, int flags) in tx2_uncore_event_stop() argument
631 struct hw_perf_event *hwc = &event->hw; in tx2_uncore_event_stop()
637 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in tx2_uncore_event_stop()
638 tx2_pmu->stop_event(event); in tx2_uncore_event_stop()
642 tx2_uncore_event_update(event); in tx2_uncore_event_stop()
647 static int tx2_uncore_event_add(struct perf_event *event, int flags) in tx2_uncore_event_add() argument
649 struct hw_perf_event *hwc = &event->hw; in tx2_uncore_event_add()
652 tx2_pmu = pmu_to_tx2_pmu(event->pmu); in tx2_uncore_event_add()
659 tx2_pmu->events[hwc->idx] = event; in tx2_uncore_event_add()
661 tx2_pmu->init_cntr_base(event, tx2_pmu); in tx2_uncore_event_add()
665 tx2_uncore_event_start(event, flags); in tx2_uncore_event_add()
670 static void tx2_uncore_event_del(struct perf_event *event, int flags) in tx2_uncore_event_del() argument
672 struct tx2_uncore_pmu *tx2_pmu = pmu_to_tx2_pmu(event->pmu); in tx2_uncore_event_del()
673 struct hw_perf_event *hwc = &event->hw; in tx2_uncore_event_del()
677 tx2_uncore_event_stop(event, PERF_EF_UPDATE); in tx2_uncore_event_del()
680 free_counter(tx2_pmu, GET_COUNTERID(event, cmask)); in tx2_uncore_event_del()
682 perf_event_update_userpage(event); in tx2_uncore_event_del()
693 static void tx2_uncore_event_read(struct perf_event *event) in tx2_uncore_event_read() argument
695 tx2_uncore_event_update(event); in tx2_uncore_event_read()
710 struct perf_event *event = tx2_pmu->events[idx]; in tx2_hrtimer_callback() local
712 tx2_uncore_event_update(event); in tx2_hrtimer_callback()