diff options
author | Alexandre Ghiti <alexghiti@rivosinc.com> | 2023-08-02 11:03:23 +0300 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2023-08-16 17:28:19 +0300 |
commit | 83c5e13b8cbbed9479cf568e03a5010d827e9781 (patch) | |
tree | a8b56e1d74bb303a6d885f2f2d525c6f64733d3e /include/linux/perf | |
parent | d5ac062d82d87124ac75e4273e3887578a7fae60 (diff) | |
download | linux-83c5e13b8cbbed9479cf568e03a5010d827e9781.tar.xz |
riscv: Prepare for user-space perf event mmap support
Provide all the necessary bits in the generic riscv pmu driver to be
able to mmap perf events in userspace: the heavy lifting lies in the
driver backend, namely the legacy and sbi implementations.
Note that arch_perf_update_userpage is almost a copy of arm64 code.
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Diffstat (limited to 'include/linux/perf')
-rw-r--r-- | include/linux/perf/riscv_pmu.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/perf/riscv_pmu.h b/include/linux/perf/riscv_pmu.h index 5deeea0be7cb..43282e22ebe1 100644 --- a/include/linux/perf/riscv_pmu.h +++ b/include/linux/perf/riscv_pmu.h @@ -55,6 +55,10 @@ struct riscv_pmu { void (*ctr_start)(struct perf_event *event, u64 init_val); void (*ctr_stop)(struct perf_event *event, unsigned long flag); int (*event_map)(struct perf_event *event, u64 *config); + void (*event_init)(struct perf_event *event); + void (*event_mapped)(struct perf_event *event, struct mm_struct *mm); + void (*event_unmapped)(struct perf_event *event, struct mm_struct *mm); + uint8_t (*csr_index)(struct perf_event *event); struct cpu_hw_events __percpu *hw_events; struct hlist_node node; |