The event mapping function can be used in event info function to find out the corresponding SBI PMU event encoding during the get_event_info function as well. Refactor and export it so that it can be invoked from kvm and internal driver.
Showing the changes to include/linux/perf (1 of 2 files). Show all
Unified · Split
| @@ -89,6 +89,7 @@ static inline void riscv_pmu_legacy_skip_init(void) {}; · 88 unmodified lines | |||
| 89 | struct riscv_pmu *riscv_pmu_alloc(void); | 89 | struct riscv_pmu *riscv_pmu_alloc(void); |
| 90 | #ifdef CONFIG_RISCV_PMU_SBI | 90 | #ifdef CONFIG_RISCV_PMU_SBI |
| 91 | int riscv_pmu_get_hpm_info(u32 *hw_ctr_width, u32 *num_hw_ctr); | 91 | int riscv_pmu_get_hpm_info(u32 *hw_ctr_width, u32 *num_hw_ctr); |
| 92 | int riscv_pmu_get_event_info(u32 type, u64 config, u64 *econfig); | ||
| 92 | #endif | 93 | #endif |
| 93 | 94 | ||
| 94 | #endif /* CONFIG_RISCV_PMU */ | 95 | #endif /* CONFIG_RISCV_PMU */ |