Lines Matching defs:cpu_hw_evt
573 struct cpu_hw_events *cpu_hw_evt = per_cpu_ptr(pmu->hw_events, cpu);
575 if (!cpu_hw_evt->snapshot_addr)
578 free_page((unsigned long)cpu_hw_evt->snapshot_addr);
579 cpu_hw_evt->snapshot_addr = NULL;
580 cpu_hw_evt->snapshot_addr_phys = 0;
590 struct cpu_hw_events *cpu_hw_evt = per_cpu_ptr(pmu->hw_events, cpu);
597 cpu_hw_evt->snapshot_addr = page_to_virt(snapshot_page);
598 cpu_hw_evt->snapshot_addr_phys = page_to_phys(snapshot_page);
620 struct cpu_hw_events *cpu_hw_evt;
623 cpu_hw_evt = per_cpu_ptr(pmu->hw_events, cpu);
624 if (!cpu_hw_evt->snapshot_addr_phys)
627 if (cpu_hw_evt->snapshot_set_done)
632 cpu_hw_evt->snapshot_addr_phys,
633 (u64)(cpu_hw_evt->snapshot_addr_phys) >> 32, 0, 0, 0, 0);
636 cpu_hw_evt->snapshot_addr_phys, 0, 0, 0, 0, 0);
645 memset(cpu_hw_evt->snapshot_cval_shcopy, 0, sizeof(u64) * RISCV_MAX_COUNTERS);
646 cpu_hw_evt->snapshot_set_done = true;
658 struct cpu_hw_events *cpu_hw_evt = this_cpu_ptr(pmu->hw_events);
659 struct riscv_pmu_snapshot_data *sdata = cpu_hw_evt->snapshot_addr;
739 struct cpu_hw_events *cpu_hw_evt = this_cpu_ptr(pmu->hw_events);
740 struct riscv_pmu_snapshot_data *sdata = cpu_hw_evt->snapshot_addr;
824 struct cpu_hw_events *cpu_hw_evt = this_cpu_ptr(pmu->hw_events);
825 struct riscv_pmu_snapshot_data *sdata = cpu_hw_evt->snapshot_addr;
835 memset(cpu_hw_evt->snapshot_cval_shcopy, 0, sizeof(u64) * RISCV_MAX_COUNTERS);
840 cpu_hw_evt->used_hw_ctrs[i], flag, 0, 0, 0);
843 for_each_set_bit(idx, &cpu_hw_evt->used_hw_ctrs[i], BITS_PER_LONG)
844 cpu_hw_evt->snapshot_cval_shcopy[i * BITS_PER_LONG + idx] =
853 for_each_set_bit(idx, cpu_hw_evt->used_hw_ctrs, RISCV_MAX_COUNTERS)
854 sdata->ctr_values[idx] = cpu_hw_evt->snapshot_cval_shcopy[idx];
866 static inline void pmu_sbi_start_ovf_ctrs_sbi(struct cpu_hw_events *cpu_hw_evt,
878 ctr_start_mask = cpu_hw_evt->used_hw_ctrs[i] & ~ctr_ovf_mask;
887 event = cpu_hw_evt->events[idx];
905 static inline void pmu_sbi_start_ovf_ctrs_snapshot(struct cpu_hw_events *cpu_hw_evt,
913 struct riscv_pmu_snapshot_data *sdata = cpu_hw_evt->snapshot_addr;
915 for_each_set_bit(idx, cpu_hw_evt->used_hw_ctrs, RISCV_MAX_COUNTERS) {
917 event = cpu_hw_evt->events[idx];
921 cpu_hw_evt->snapshot_cval_shcopy[idx] = init_val;
931 for_each_set_bit(idx, &cpu_hw_evt->used_hw_ctrs[i], BITS_PER_LONG)
933 cpu_hw_evt->snapshot_cval_shcopy[idx + i * BITS_PER_LONG];
936 cpu_hw_evt->used_hw_ctrs[i], flag, 0, 0, 0);
943 struct cpu_hw_events *cpu_hw_evt = this_cpu_ptr(pmu->hw_events);
946 pmu_sbi_start_ovf_ctrs_snapshot(cpu_hw_evt, ctr_ovf_mask);
948 pmu_sbi_start_ovf_ctrs_sbi(cpu_hw_evt, ctr_ovf_mask);
962 struct cpu_hw_events *cpu_hw_evt = dev;
964 struct riscv_pmu_snapshot_data *sdata = cpu_hw_evt->snapshot_addr;
966 if (WARN_ON_ONCE(!cpu_hw_evt))
970 fidx = find_first_bit(cpu_hw_evt->used_hw_ctrs, RISCV_MAX_COUNTERS);
976 event = cpu_hw_evt->events[fidx];
1003 for_each_set_bit(lidx, cpu_hw_evt->used_hw_ctrs, RISCV_MAX_COUNTERS) {
1004 struct perf_event *event = cpu_hw_evt->events[lidx];
1061 struct cpu_hw_events *cpu_hw_evt = this_cpu_ptr(pmu->hw_events);
1076 cpu_hw_evt->irq = riscv_pmu_irq;