Re: [PATCH v3] perf vendor events riscv: Add C-SKY C930 JSON file

From: fangyu . yu

Date: Thu Nov 05 2026 - 09:38:03 EST


>From: Chen Pei <cp0613@xxxxxxxxxxxxxxxxx>
>
>Add PMU event descriptions for the C-SKY C930 core so perf can list and
>select its hardware events by name instead of requiring raw event codes.
>The events cover core counters, branch prediction, instruction fetch,
>integer execution, load/store operations, vector and floating-point
>execution, caches and TLBs.
>
>Add a mapfile.csv entry matching mvendorid 0x5b7 and marchid
>0x8000000009201600, allowing any mimpid, to select the C930 event table.
>
>For example:
>
>perf stat -e cache.l1d.rd.miss,tlb.l1d.miss ./workload
>

Tested on C930 core. `perf list` shows the C930 events, and
`perf stat -e <event list>` works as expected on C930.

Tested-by: Fangyu Yu <fangyu.yu@xxxxxxxxxxxxxxxxx>

>Signed-off-by: Chen Pei <cp0613@xxxxxxxxxxxxxxxxx>
>Signed-off-by: GUO Ren (XuanTie) <guoren@xxxxxxxxxx>
>---
>XuanTie is the RISC-V processor brand of C-SKY Microsystems Co., Ltd.
>[2]. JEDEC JEP106AB lists C-SKY Microsystems Co., Ltd. as the manufacturer
>associated with ID 0x5b7 [3]. Accordingly, use C-SKY in the patch title
>and csky/ as the vendor directory.
>
>This revision is limited to the PMU event descriptions from v2 3/4.
>perf selects the event table by matching mvendorid, marchid and mimpid,
>so the DT binding additions are not required for this patch. The
>derived metrics patch is also omitted from this revision.
>
>Changes in v3:
> - Repost only the PMU event patch. Omit the DT binding patches
> (v2 1/4 and 2/4) and the derived metrics patch (v2 4/4).
> - Rename the vendor directory from xuantie/ to csky/ and update the
> mapfile.csv entry accordingly.
> - Change the patch title to "Add C-SKY C930 PMU events".
> - Drop the topdown.* events, uop.spec, uop.ret, ieu.de.inst_cnt,
> ieu.rn.inst_cnt and vfpu_ex1_rep.
>
>Changes in v2:
>v2: https://lore.kernel.org/linux-riscv/20251121063439.2545-1-cp0613@xxxxxxxxxxxxxxxxx/
> - Vendor name update.
>
>Previous versions:
>v1: https://lore.kernel.org/linux-riscv/20250910121121.7203-1-cp0613@xxxxxxxxxxxxxxxxx/
>
>References:
>[1] https://www.xrvm.com/product/xuantie/C930
>[2] https://www.xrvm.com/declaration
>[3] https://www.jedec.org/standards-documents/docs/jep-106ab