Lines Matching refs:cpu_pmu

656 #define	ARMV7_IDX_COUNTER_LAST(cpu_pmu) \  argument
657 (ARMV7_IDX_CYCLE_COUNTER + cpu_pmu->num_events - 1)
728 static inline int armv7_pmnc_counter_valid(struct arm_pmu *cpu_pmu, int idx) in armv7_pmnc_counter_valid() argument
731 idx <= ARMV7_IDX_COUNTER_LAST(cpu_pmu); in armv7_pmnc_counter_valid()
748 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in armv7pmu_read_counter() local
753 if (!armv7_pmnc_counter_valid(cpu_pmu, idx)) { in armv7pmu_read_counter()
768 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in armv7pmu_write_counter() local
772 if (!armv7_pmnc_counter_valid(cpu_pmu, idx)) { in armv7pmu_write_counter()
833 static void armv7_pmnc_dump_regs(struct arm_pmu *cpu_pmu) in armv7_pmnc_dump_regs() argument
859 cnt <= ARMV7_IDX_COUNTER_LAST(cpu_pmu); cnt++) { in armv7_pmnc_dump_regs()
875 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in armv7pmu_enable_event() local
876 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in armv7pmu_enable_event()
879 if (!armv7_pmnc_counter_valid(cpu_pmu, idx)) { in armv7pmu_enable_event()
901 if (cpu_pmu->set_event_filter || idx != ARMV7_IDX_CYCLE_COUNTER) in armv7pmu_enable_event()
921 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in armv7pmu_disable_event() local
922 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in armv7pmu_disable_event()
925 if (!armv7_pmnc_counter_valid(cpu_pmu, idx)) { in armv7pmu_disable_event()
949 static irqreturn_t armv7pmu_handle_irq(struct arm_pmu *cpu_pmu) in armv7pmu_handle_irq() argument
953 struct pmu_hw_events *cpuc = this_cpu_ptr(cpu_pmu->hw_events); in armv7pmu_handle_irq()
973 for (idx = 0; idx < cpu_pmu->num_events; ++idx) { in armv7pmu_handle_irq()
995 cpu_pmu->disable(event); in armv7pmu_handle_irq()
1010 static void armv7pmu_start(struct arm_pmu *cpu_pmu) in armv7pmu_start() argument
1013 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in armv7pmu_start()
1021 static void armv7pmu_stop(struct arm_pmu *cpu_pmu) in armv7pmu_stop() argument
1024 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in armv7pmu_stop()
1036 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in armv7pmu_get_event_idx() local
1052 for (idx = ARMV7_IDX_COUNTER0; idx < cpu_pmu->num_events; ++idx) { in armv7pmu_get_event_idx()
1095 struct arm_pmu *cpu_pmu = (struct arm_pmu *)info; in armv7pmu_reset() local
1096 u32 idx, nb_cnt = cpu_pmu->num_events, val; in armv7pmu_reset()
1098 if (cpu_pmu->secure_access) { in armv7pmu_reset()
1168 static void armv7pmu_init(struct arm_pmu *cpu_pmu) in armv7pmu_init() argument
1170 cpu_pmu->handle_irq = armv7pmu_handle_irq; in armv7pmu_init()
1171 cpu_pmu->enable = armv7pmu_enable_event; in armv7pmu_init()
1172 cpu_pmu->disable = armv7pmu_disable_event; in armv7pmu_init()
1173 cpu_pmu->read_counter = armv7pmu_read_counter; in armv7pmu_init()
1174 cpu_pmu->write_counter = armv7pmu_write_counter; in armv7pmu_init()
1175 cpu_pmu->get_event_idx = armv7pmu_get_event_idx; in armv7pmu_init()
1176 cpu_pmu->clear_event_idx = armv7pmu_clear_event_idx; in armv7pmu_init()
1177 cpu_pmu->start = armv7pmu_start; in armv7pmu_init()
1178 cpu_pmu->stop = armv7pmu_stop; in armv7pmu_init()
1179 cpu_pmu->reset = armv7pmu_reset; in armv7pmu_init()
1200 static int armv7_a8_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a8_pmu_init() argument
1202 armv7pmu_init(cpu_pmu); in armv7_a8_pmu_init()
1203 cpu_pmu->name = "armv7_cortex_a8"; in armv7_a8_pmu_init()
1204 cpu_pmu->map_event = armv7_a8_map_event; in armv7_a8_pmu_init()
1205 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = in armv7_a8_pmu_init()
1207 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = in armv7_a8_pmu_init()
1209 return armv7_probe_num_events(cpu_pmu); in armv7_a8_pmu_init()
1212 static int armv7_a9_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a9_pmu_init() argument
1214 armv7pmu_init(cpu_pmu); in armv7_a9_pmu_init()
1215 cpu_pmu->name = "armv7_cortex_a9"; in armv7_a9_pmu_init()
1216 cpu_pmu->map_event = armv7_a9_map_event; in armv7_a9_pmu_init()
1217 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = in armv7_a9_pmu_init()
1219 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = in armv7_a9_pmu_init()
1221 return armv7_probe_num_events(cpu_pmu); in armv7_a9_pmu_init()
1224 static int armv7_a5_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a5_pmu_init() argument
1226 armv7pmu_init(cpu_pmu); in armv7_a5_pmu_init()
1227 cpu_pmu->name = "armv7_cortex_a5"; in armv7_a5_pmu_init()
1228 cpu_pmu->map_event = armv7_a5_map_event; in armv7_a5_pmu_init()
1229 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = in armv7_a5_pmu_init()
1231 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = in armv7_a5_pmu_init()
1233 return armv7_probe_num_events(cpu_pmu); in armv7_a5_pmu_init()
1236 static int armv7_a15_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a15_pmu_init() argument
1238 armv7pmu_init(cpu_pmu); in armv7_a15_pmu_init()
1239 cpu_pmu->name = "armv7_cortex_a15"; in armv7_a15_pmu_init()
1240 cpu_pmu->map_event = armv7_a15_map_event; in armv7_a15_pmu_init()
1241 cpu_pmu->set_event_filter = armv7pmu_set_event_filter; in armv7_a15_pmu_init()
1242 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = in armv7_a15_pmu_init()
1244 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = in armv7_a15_pmu_init()
1246 return armv7_probe_num_events(cpu_pmu); in armv7_a15_pmu_init()
1249 static int armv7_a7_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a7_pmu_init() argument
1251 armv7pmu_init(cpu_pmu); in armv7_a7_pmu_init()
1252 cpu_pmu->name = "armv7_cortex_a7"; in armv7_a7_pmu_init()
1253 cpu_pmu->map_event = armv7_a7_map_event; in armv7_a7_pmu_init()
1254 cpu_pmu->set_event_filter = armv7pmu_set_event_filter; in armv7_a7_pmu_init()
1255 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = in armv7_a7_pmu_init()
1257 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = in armv7_a7_pmu_init()
1259 return armv7_probe_num_events(cpu_pmu); in armv7_a7_pmu_init()
1262 static int armv7_a12_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a12_pmu_init() argument
1264 armv7pmu_init(cpu_pmu); in armv7_a12_pmu_init()
1265 cpu_pmu->name = "armv7_cortex_a12"; in armv7_a12_pmu_init()
1266 cpu_pmu->map_event = armv7_a12_map_event; in armv7_a12_pmu_init()
1267 cpu_pmu->set_event_filter = armv7pmu_set_event_filter; in armv7_a12_pmu_init()
1268 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = in armv7_a12_pmu_init()
1270 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = in armv7_a12_pmu_init()
1272 return armv7_probe_num_events(cpu_pmu); in armv7_a12_pmu_init()
1275 static int armv7_a17_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a17_pmu_init() argument
1277 int ret = armv7_a12_pmu_init(cpu_pmu); in armv7_a17_pmu_init()
1278 cpu_pmu->name = "armv7_cortex_a17"; in armv7_a17_pmu_init()
1279 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = in armv7_a17_pmu_init()
1281 cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = in armv7_a17_pmu_init()
1498 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in krait_pmu_disable_event() local
1499 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in krait_pmu_disable_event()
1524 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in krait_pmu_enable_event() local
1525 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in krait_pmu_enable_event()
1558 struct arm_pmu *cpu_pmu = info; in krait_pmu_reset() local
1559 u32 idx, nb_cnt = cpu_pmu->num_events; in krait_pmu_reset()
1585 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in krait_event_to_bit() local
1597 bit += ARMV7_IDX_COUNTER_LAST(cpu_pmu) + 1; in krait_event_to_bit()
1654 static int krait_pmu_init(struct arm_pmu *cpu_pmu) in krait_pmu_init() argument
1656 armv7pmu_init(cpu_pmu); in krait_pmu_init()
1657 cpu_pmu->name = "armv7_krait"; in krait_pmu_init()
1659 if (of_property_read_bool(cpu_pmu->plat_device->dev.of_node, in krait_pmu_init()
1661 cpu_pmu->map_event = krait_map_event_no_branch; in krait_pmu_init()
1663 cpu_pmu->map_event = krait_map_event; in krait_pmu_init()
1664 cpu_pmu->set_event_filter = armv7pmu_set_event_filter; in krait_pmu_init()
1665 cpu_pmu->reset = krait_pmu_reset; in krait_pmu_init()
1666 cpu_pmu->enable = krait_pmu_enable_event; in krait_pmu_init()
1667 cpu_pmu->disable = krait_pmu_disable_event; in krait_pmu_init()
1668 cpu_pmu->get_event_idx = krait_pmu_get_event_idx; in krait_pmu_init()
1669 cpu_pmu->clear_event_idx = krait_pmu_clear_event_idx; in krait_pmu_init()
1670 return armv7_probe_num_events(cpu_pmu); in krait_pmu_init()
1831 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in scorpion_pmu_disable_event() local
1832 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in scorpion_pmu_disable_event()
1857 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in scorpion_pmu_enable_event() local
1858 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in scorpion_pmu_enable_event()
1891 struct arm_pmu *cpu_pmu = info; in scorpion_pmu_reset() local
1892 u32 idx, nb_cnt = cpu_pmu->num_events; in scorpion_pmu_reset()
1918 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in scorpion_event_to_bit() local
1930 bit += ARMV7_IDX_COUNTER_LAST(cpu_pmu) + 1; in scorpion_event_to_bit()
1984 static int scorpion_pmu_init(struct arm_pmu *cpu_pmu) in scorpion_pmu_init() argument
1986 armv7pmu_init(cpu_pmu); in scorpion_pmu_init()
1987 cpu_pmu->name = "armv7_scorpion"; in scorpion_pmu_init()
1988 cpu_pmu->map_event = scorpion_map_event; in scorpion_pmu_init()
1989 cpu_pmu->reset = scorpion_pmu_reset; in scorpion_pmu_init()
1990 cpu_pmu->enable = scorpion_pmu_enable_event; in scorpion_pmu_init()
1991 cpu_pmu->disable = scorpion_pmu_disable_event; in scorpion_pmu_init()
1992 cpu_pmu->get_event_idx = scorpion_pmu_get_event_idx; in scorpion_pmu_init()
1993 cpu_pmu->clear_event_idx = scorpion_pmu_clear_event_idx; in scorpion_pmu_init()
1994 return armv7_probe_num_events(cpu_pmu); in scorpion_pmu_init()
1997 static int scorpion_mp_pmu_init(struct arm_pmu *cpu_pmu) in scorpion_mp_pmu_init() argument
1999 armv7pmu_init(cpu_pmu); in scorpion_mp_pmu_init()
2000 cpu_pmu->name = "armv7_scorpion_mp"; in scorpion_mp_pmu_init()
2001 cpu_pmu->map_event = scorpion_map_event; in scorpion_mp_pmu_init()
2002 cpu_pmu->reset = scorpion_pmu_reset; in scorpion_mp_pmu_init()
2003 cpu_pmu->enable = scorpion_pmu_enable_event; in scorpion_mp_pmu_init()
2004 cpu_pmu->disable = scorpion_pmu_disable_event; in scorpion_mp_pmu_init()
2005 cpu_pmu->get_event_idx = scorpion_pmu_get_event_idx; in scorpion_mp_pmu_init()
2006 cpu_pmu->clear_event_idx = scorpion_pmu_clear_event_idx; in scorpion_mp_pmu_init()
2007 return armv7_probe_num_events(cpu_pmu); in scorpion_mp_pmu_init()