Lines Matching refs:cpuc
253 static int loongarch_pmu_alloc_counter(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc) in loongarch_pmu_alloc_counter() argument
258 if (!test_and_set_bit(i, cpuc->used_mask)) in loongarch_pmu_alloc_counter()
269 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in loongarch_pmu_enable_event() local
274 cpuc->saved_ctrl[idx] = M_PERFCTL_EVENT(evt->event_base & 0xff) | in loongarch_pmu_enable_event()
288 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in loongarch_pmu_disable_event() local
293 cpuc->saved_ctrl[idx] = loongarch_pmu_read_control(idx) & in loongarch_pmu_disable_event()
295 loongarch_pmu_write_control(idx, cpuc->saved_ctrl[idx]); in loongarch_pmu_disable_event()
388 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in loongarch_pmu_add() local
394 idx = loongarch_pmu_alloc_counter(cpuc, hwc); in loongarch_pmu_add()
406 cpuc->events[idx] = event; in loongarch_pmu_add()
422 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in loongarch_pmu_del() local
429 cpuc->events[idx] = NULL; in loongarch_pmu_del()
430 clear_bit(idx, cpuc->used_mask); in loongarch_pmu_del()
481 static void handle_associated_event(struct cpu_hw_events *cpuc, int idx, in handle_associated_event() argument
484 struct perf_event *event = cpuc->events[idx]; in handle_associated_event()
503 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in pmu_handle_irq() local
519 if (test_bit(n, cpuc->used_mask)) { in pmu_handle_irq()
522 handle_associated_event(cpuc, n, &data, regs); in pmu_handle_irq()
827 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in pause_local_counters() local
832 cpuc->saved_ctrl[ctr] = loongarch_pmu_read_control(ctr); in pause_local_counters()
833 loongarch_pmu_write_control(ctr, cpuc->saved_ctrl[ctr] & in pause_local_counters()
842 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in resume_local_counters() local
846 loongarch_pmu_write_control(ctr, cpuc->saved_ctrl[ctr]); in resume_local_counters()