Lines Matching refs:event

160 		struct perf_event *event;  member
240 static CCN_FORMAT_ATTR(event, "config:16-23");
271 u32 event; member
290 .type = CCN_TYPE_MN, .event = CCN_EVENT_WATCHPOINT, \
296 .event = CCN_EVENT_WATCHPOINT, .num_ports = CCN_NUM_XP_PORTS, \
301 .event = CCN_EVENT_WATCHPOINT, .num_ports = CCN_NUM_XP_PORTS, \
305 .type = CCN_TYPE_HNF, .event = _event, }
308 .type = CCN_TYPE_XP, .event = _event, \
317 .type = CCN_TYPE_RNI_3P, .event = _event, }
320 .type = CCN_TYPE_SBAS, .event = _event, }
329 struct arm_ccn_pmu_event *event = container_of(attr, in arm_ccn_pmu_event_show() local
333 res = snprintf(buf, PAGE_SIZE, "type=0x%x", event->type); in arm_ccn_pmu_event_show()
334 if (event->event) in arm_ccn_pmu_event_show()
336 event->event); in arm_ccn_pmu_event_show()
337 if (event->def) in arm_ccn_pmu_event_show()
339 event->def); in arm_ccn_pmu_event_show()
340 if (event->mask) in arm_ccn_pmu_event_show()
342 event->mask); in arm_ccn_pmu_event_show()
345 switch (event->type) { in arm_ccn_pmu_event_show()
351 if (event->event == CCN_EVENT_WATCHPOINT) in arm_ccn_pmu_event_show()
372 struct arm_ccn_pmu_event *event = container_of(dev_attr, in arm_ccn_pmu_events_is_visible() local
375 if (event->type == CCN_TYPE_SBAS && !ccn->sbas_present) in arm_ccn_pmu_events_is_visible()
377 if (event->type == CCN_TYPE_SBSX && !ccn->sbsx_present) in arm_ccn_pmu_events_is_visible()
631 static int arm_ccn_pmu_event_alloc(struct perf_event *event) in arm_ccn_pmu_event_alloc() argument
633 struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_event_alloc()
634 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_event_alloc()
639 node_xp = CCN_CONFIG_NODE(event->attr.config); in arm_ccn_pmu_event_alloc()
640 type = CCN_CONFIG_TYPE(event->attr.config); in arm_ccn_pmu_event_alloc()
641 event_id = CCN_CONFIG_EVENT(event->attr.config); in arm_ccn_pmu_event_alloc()
650 ccn->dt.pmu_counters[CCN_IDX_PMU_CYCLE_COUNTER].event = event; in arm_ccn_pmu_event_alloc()
684 ccn->dt.pmu_counters[hw->idx].event = event; in arm_ccn_pmu_event_alloc()
689 static void arm_ccn_pmu_event_release(struct perf_event *event) in arm_ccn_pmu_event_release() argument
691 struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_event_release()
692 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_event_release()
700 if (CCN_CONFIG_TYPE(event->attr.config) == CCN_TYPE_XP && in arm_ccn_pmu_event_release()
701 CCN_CONFIG_EVENT(event->attr.config) == in arm_ccn_pmu_event_release()
710 ccn->dt.pmu_counters[hw->idx].event = NULL; in arm_ccn_pmu_event_release()
713 static int arm_ccn_pmu_event_init(struct perf_event *event) in arm_ccn_pmu_event_init() argument
716 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_event_init()
722 if (event->attr.type != event->pmu->type) in arm_ccn_pmu_event_init()
725 ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_event_init()
732 if (has_branch_stack(event) || event->attr.exclude_user || in arm_ccn_pmu_event_init()
733 event->attr.exclude_kernel || event->attr.exclude_hv || in arm_ccn_pmu_event_init()
734 event->attr.exclude_idle) { in arm_ccn_pmu_event_init()
739 if (event->cpu < 0) { in arm_ccn_pmu_event_init()
752 event->cpu = cpumask_first(&ccn->dt.cpu); in arm_ccn_pmu_event_init()
754 node_xp = CCN_CONFIG_NODE(event->attr.config); in arm_ccn_pmu_event_init()
755 type = CCN_CONFIG_TYPE(event->attr.config); in arm_ccn_pmu_event_init()
756 event_id = CCN_CONFIG_EVENT(event->attr.config); in arm_ccn_pmu_event_init()
785 u32 port = CCN_CONFIG_PORT(event->attr.config); in arm_ccn_pmu_event_init()
786 u32 vc = CCN_CONFIG_VC(event->attr.config); in arm_ccn_pmu_event_init()
790 if (event_id != e->event) in arm_ccn_pmu_event_init()
818 arm_ccn_pmu_config_set(&event->attr.config, in arm_ccn_pmu_event_init()
827 if (event->group_leader->pmu != event->pmu && in arm_ccn_pmu_event_init()
828 !is_software_event(event->group_leader)) in arm_ccn_pmu_event_init()
831 list_for_each_entry(sibling, &event->group_leader->sibling_list, in arm_ccn_pmu_event_init()
833 if (sibling->pmu != event->pmu && in arm_ccn_pmu_event_init()
864 static void arm_ccn_pmu_event_update(struct perf_event *event) in arm_ccn_pmu_event_update() argument
866 struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_event_update()
867 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_event_update()
877 local64_add((new_count - prev_count) & mask, &event->count); in arm_ccn_pmu_event_update()
880 static void arm_ccn_pmu_xp_dt_config(struct perf_event *event, int enable) in arm_ccn_pmu_xp_dt_config() argument
882 struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_xp_dt_config()
883 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_xp_dt_config()
887 if (CCN_CONFIG_TYPE(event->attr.config) == CCN_TYPE_XP) in arm_ccn_pmu_xp_dt_config()
888 xp = &ccn->xp[CCN_CONFIG_XP(event->attr.config)]; in arm_ccn_pmu_xp_dt_config()
891 CCN_CONFIG_NODE(event->attr.config))]; in arm_ccn_pmu_xp_dt_config()
909 static void arm_ccn_pmu_event_start(struct perf_event *event, int flags) in arm_ccn_pmu_event_start() argument
911 struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_event_start()
912 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_event_start()
914 local64_set(&event->hw.prev_count, in arm_ccn_pmu_event_start()
928 arm_ccn_pmu_xp_dt_config(event, 1); in arm_ccn_pmu_event_start()
931 static void arm_ccn_pmu_event_stop(struct perf_event *event, int flags) in arm_ccn_pmu_event_stop() argument
933 struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_event_stop()
934 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_event_stop()
938 arm_ccn_pmu_xp_dt_config(event, 0); in arm_ccn_pmu_event_stop()
951 arm_ccn_pmu_event_update(event); in arm_ccn_pmu_event_stop()
956 static void arm_ccn_pmu_xp_watchpoint_config(struct perf_event *event) in arm_ccn_pmu_xp_watchpoint_config() argument
958 struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_xp_watchpoint_config()
959 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_xp_watchpoint_config()
964 u64 cmp_l = event->attr.config1; in arm_ccn_pmu_xp_watchpoint_config()
965 u64 cmp_h = event->attr.config2; in arm_ccn_pmu_xp_watchpoint_config()
966 u64 mask_l = ccn->dt.cmp_mask[CCN_CONFIG_MASK(event->attr.config)].l; in arm_ccn_pmu_xp_watchpoint_config()
967 u64 mask_h = ccn->dt.cmp_mask[CCN_CONFIG_MASK(event->attr.config)].h; in arm_ccn_pmu_xp_watchpoint_config()
975 val |= CCN_CONFIG_DIR(event->attr.config) << in arm_ccn_pmu_xp_watchpoint_config()
979 val |= CCN_CONFIG_PORT(event->attr.config) << in arm_ccn_pmu_xp_watchpoint_config()
983 val |= CCN_CONFIG_VC(event->attr.config) << in arm_ccn_pmu_xp_watchpoint_config()
1004 static void arm_ccn_pmu_xp_event_config(struct perf_event *event) in arm_ccn_pmu_xp_event_config() argument
1006 struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_xp_event_config()
1007 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_xp_event_config()
1014 id = (CCN_CONFIG_VC(event->attr.config) << 4) | in arm_ccn_pmu_xp_event_config()
1015 (CCN_CONFIG_PORT(event->attr.config) << 3) | in arm_ccn_pmu_xp_event_config()
1016 (CCN_CONFIG_EVENT(event->attr.config) << 0); in arm_ccn_pmu_xp_event_config()
1025 static void arm_ccn_pmu_node_event_config(struct perf_event *event) in arm_ccn_pmu_node_event_config() argument
1027 struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_node_event_config()
1028 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_node_event_config()
1031 u32 type = CCN_CONFIG_TYPE(event->attr.config); in arm_ccn_pmu_node_event_config()
1034 port = arm_ccn_node_to_xp_port(CCN_CONFIG_NODE(event->attr.config)); in arm_ccn_pmu_node_event_config()
1057 val |= CCN_CONFIG_EVENT(event->attr.config) << in arm_ccn_pmu_node_event_config()
1062 static void arm_ccn_pmu_event_config(struct perf_event *event) in arm_ccn_pmu_event_config() argument
1064 struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu); in arm_ccn_pmu_event_config()
1065 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_event_config()
1072 if (CCN_CONFIG_TYPE(event->attr.config) == CCN_TYPE_XP) in arm_ccn_pmu_event_config()
1073 xp = CCN_CONFIG_XP(event->attr.config); in arm_ccn_pmu_event_config()
1075 xp = arm_ccn_node_to_xp(CCN_CONFIG_NODE(event->attr.config)); in arm_ccn_pmu_event_config()
1087 if (CCN_CONFIG_TYPE(event->attr.config) == CCN_TYPE_XP) { in arm_ccn_pmu_event_config()
1088 if (CCN_CONFIG_EVENT(event->attr.config) == in arm_ccn_pmu_event_config()
1090 arm_ccn_pmu_xp_watchpoint_config(event); in arm_ccn_pmu_event_config()
1092 arm_ccn_pmu_xp_event_config(event); in arm_ccn_pmu_event_config()
1094 arm_ccn_pmu_node_event_config(event); in arm_ccn_pmu_event_config()
1100 static int arm_ccn_pmu_event_add(struct perf_event *event, int flags) in arm_ccn_pmu_event_add() argument
1103 struct hw_perf_event *hw = &event->hw; in arm_ccn_pmu_event_add()
1105 err = arm_ccn_pmu_event_alloc(event); in arm_ccn_pmu_event_add()
1109 arm_ccn_pmu_event_config(event); in arm_ccn_pmu_event_add()
1114 arm_ccn_pmu_event_start(event, PERF_EF_UPDATE); in arm_ccn_pmu_event_add()
1119 static void arm_ccn_pmu_event_del(struct perf_event *event, int flags) in arm_ccn_pmu_event_del() argument
1121 arm_ccn_pmu_event_stop(event, PERF_EF_UPDATE); in arm_ccn_pmu_event_del()
1123 arm_ccn_pmu_event_release(event); in arm_ccn_pmu_event_del()
1126 static void arm_ccn_pmu_event_read(struct perf_event *event) in arm_ccn_pmu_event_read() argument
1128 arm_ccn_pmu_event_update(event); in arm_ccn_pmu_event_read()
1144 struct perf_event *event = dt->pmu_counters[idx].event; in arm_ccn_pmu_overflow_handler() local
1147 WARN_ON_ONCE(overflowed && !event && in arm_ccn_pmu_overflow_handler()
1150 if (!event || !overflowed) in arm_ccn_pmu_overflow_handler()
1153 arm_ccn_pmu_event_update(event); in arm_ccn_pmu_overflow_handler()