Lines Matching refs:riscv_pmu
35 static const struct riscv_pmu *riscv_pmu __read_mostly;
144 if (config >= riscv_pmu->max_events) in riscv_map_hw_event()
147 return riscv_pmu->hw_events[config]; in riscv_map_hw_event()
163 if (!riscv_pmu->cache_events || err) in riscv_map_cache_event()
171 code = (*riscv_pmu->cache_events)[type][op][result]; in riscv_map_cache_event()
234 ((1ULL << riscv_pmu->counter_width) - 1); in riscv_pmu_read()
259 riscv_pmu->pmu->read(event); in riscv_pmu_stop()
302 if (cpuc->n_events == riscv_pmu->num_counters) in riscv_pmu_add()
320 riscv_pmu->pmu->start(event, PERF_EF_RELOAD); in riscv_pmu_add()
335 riscv_pmu->pmu->stop(event, PERF_EF_UPDATE); in riscv_pmu_del()
355 if (riscv_pmu->irq >= 0 && riscv_pmu->handle_irq) { in reserve_pmc_hardware()
356 err = request_irq(riscv_pmu->irq, riscv_pmu->handle_irq, in reserve_pmc_hardware()
367 if (riscv_pmu->irq >= 0) in release_pmc_hardware()
368 free_irq(riscv_pmu->irq, NULL); in release_pmc_hardware()
403 code = riscv_pmu->map_hw_event(attr->config); in riscv_event_init()
406 code = riscv_pmu->map_cache_event(attr->config); in riscv_event_init()
447 static const struct riscv_pmu riscv_base_pmu = {
472 riscv_pmu = &riscv_base_pmu; in init_hw_perf_events()
478 riscv_pmu = of_id->data; in init_hw_perf_events()
482 perf_pmu_register(riscv_pmu->pmu, "cpu", PERF_TYPE_RAW); in init_hw_perf_events()