linux-loongson/tools/perf/pmu-events/arch/powerpc
Athira Rajeev 86f45d0f17 tools/perf/pmu-events/powerpc: Add support for compat events in json
perf list picks the events supported for specific platform
from pmu-events/arch/powerpc/<platform>. Example power10 events
are in pmu-events/arch/powerpc/power10, power9 events are part
of pmu-events/arch/powerpc/power9. The decision of which
platform to pick is determined based on PVR value in powerpc.
The PVR value is matched from pmu-events/arch/powerpc/mapfile.csv

Example:

Format:
        PVR,Version,JSON/file/pathname,Type

0x004[bcd][[:xdigit:]]{4},1,power8,core
0x0066[[:xdigit:]]{4},1,power8,core
0x004e[[:xdigit:]]{4},1,power9,core
0x0080[[:xdigit:]]{4},1,power10,core
0x0082[[:xdigit:]]{4},1,power10,core

The code gets the PVR from system using get_cpuid_str function
in arch/powerpc/util/headers.c ( from SPRN_PVR ) and compares
with value from mapfile.csv

In case of compat mode, say when partition is booted in a power9
mode when the system is a power10, add an entry to pick the
ISA architected events from "pmu-events/arch/powerpc/compat".
Add json file generic-events.json which will contain these
events which is supported in compat mode.

Suggested-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Tested-by: Disha Goel <disgoel@linux.ibm.com>
Cc: akanksha@linux.ibm.com
Cc: hbathini@linux.ibm.com
Cc: kjain@linux.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20241010145107.51211-1-atrajeev@linux.vnet.ibm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2024-10-17 11:24:52 -07:00
..
compat tools/perf/pmu-events/powerpc: Add support for compat events in json 2024-10-17 11:24:52 -07:00
power8 perf vendor events powerpc: Fix spelling mistake "icach" -> "icache" 2021-09-27 09:32:28 -03:00
power9 perf vendor events power9: Remove UTF-8 characters from JSON files 2023-04-04 09:39:55 -03:00
power10 perf vendor events: Move PM_BR_MPRED_CMPL event for power10 platform 2024-08-28 18:10:24 -03:00
mapfile.csv tools/perf/pmu-events/powerpc: Add support for compat events in json 2024-10-17 11:24:52 -07:00