linux-stable/tools/perf/arch
Athira Rajeev 54f9aa1092 tools/perf/powerpc/util: Add support to handle compatible mode PVR for perf json events
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, this picks incorrectly. Because
PVR will point to power10 where as it should pick events from power9
folder. To support generic events, add new folder
pmu-events/arch/powerpc/compat to contain the ISA architected events
which is supported in compat mode. Also return 0x00ffffff as pvr
when booted in compat mode. Based on this pvr value, json will
pick events from pmu-events/arch/powerpc/compat

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-2-atrajeev@linux.vnet.ibm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2024-10-17 11:25:00 -07:00
..
alpha perf tools: Add empty Build files for architectures lacking them 2015-08-06 16:24:15 -03:00
arc/annotate perf annotate: Introduce basic support for ARC 2018-12-17 14:59:42 -03:00
arm perf: cs-etm: Only save valid trace IDs into files 2024-08-29 15:55:52 -03:00
arm64 perf tool_pmu: Move expr literals to tool_pmu 2024-10-10 23:40:32 -07:00
csky perf util: Make util its own library 2024-06-26 11:07:42 -07:00
loongarch perf annotate: Update parameters for reg extract functions to use raw instruction on powerpc 2024-07-31 16:12:59 -03:00
mips Merge remote-tracking branch 'perf-tools' into perf-tools-next 2024-07-02 11:51:32 -07:00
parisc perf tools: Add empty Build files for architectures lacking them 2015-08-06 16:24:15 -03:00
powerpc tools/perf/powerpc/util: Add support to handle compatible mode PVR for perf json events 2024-10-17 11:25:00 -07:00
riscv ARM: 2024-07-20 12:41:03 -07:00
riscv64/annotate perf annotate: Add riscv64 support 2021-09-27 09:33:44 -03:00
s390 Merge remote-tracking branch 'torvalds/master' into perf-tools-next 2024-08-16 19:43:16 -03:00
sh perf util: Make util its own library 2024-06-26 11:07:42 -07:00
sparc perf util: Make util its own library 2024-06-26 11:07:42 -07:00
x86 perf x86/topdown: Refine helper arch_is_topdown_metrics() 2024-10-16 13:36:47 -07:00
xtensa perf util: Make util its own library 2024-06-26 11:07:42 -07:00
Build perf util: Make util its own library 2024-06-26 11:07:42 -07:00
common.c perf tools riscv: Add support for riscv lookup_binutils_path 2023-05-12 15:21:48 -03:00
common.h perf annotate: Own objdump_path and disassembler_style strings 2023-04-04 09:39:56 -03:00