Re: [PATCH v8 16/22] RISC-V: perf: Use config2/vendor table for event to counter mapping

From: Charlie Jenkins

Date: Mon Jul 20 2026 - 03:25:37 EST


On Wed, 01 Jul 2026 01:47:04 -0700, Atish Patra <atish.patra@xxxxxxxxx> wrote:
> The counter restriction specified in the json file is passed to
> the drivers via config2 paarameter in perf attributes. This allows
> any platform vendor to define their custom mapping between event and
> hpmcounters without any rules defined in the ISA.
>
> For legacy events, the platform vendor may define the mapping in
> the driver in the vendor event table.
> The fixed cycle and instruction counters are fixed (0 and 2
> respectively) by the ISA and maps to the legacy events. The platform
> vendor must specify this in the driver if intended to be used while
> profiling. Otherwise, they can just specify the alternate hpmcounters
> that may monitor and/or sample the cycle/instruction counts.
>
> [...]

Reviewed-by: Charlie Jenkins <thecharlesjenkins@xxxxxxxxx>
Tested-by: Charlie Jenkins <thecharlesjenkins@xxxxxxxxx>

--
- Charlie