[PATCH v8 16/22] RISC-V: perf: Use config2/vendor table for event to counter mapping
Charlie Jenkins
thecharlesjenkins at gmail.com
Mon Jul 20 00:21:59 PDT 2026
On Wed, 01 Jul 2026 01:47:04 -0700, Atish Patra <atish.patra at linux.dev> 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 at gmail.com>
Tested-by: Charlie Jenkins <thecharlesjenkins at gmail.com>
--
- Charlie
More information about the linux-riscv
mailing list