perf tools arch powerpc: Add register mask for power11 PVR in extended regs
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Fri, 6 Dec 2024 13:56:37 +0000 (19:26 +0530)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 18 Dec 2024 19:24:31 +0000 (16:24 -0300)
Perf tools side uses extended mask to display the platform supported
register names (with -I? option) to the user and also send this mask to
the kernel to capture the extended registers as part of each sample.
This mask value is decided based on the processor version ( from PVR ).

Add PVR value for power11 to enable capturing the extended regs as part
of sample in power11.

Reviewed-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20241206135637.36166-1-atrajeev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/powerpc/util/perf_regs.c

index e8e6e6fc6f176a57aa2db840e777d7b00ef79921..bd36cfd420a224d8367bdc293853f0268f96b4b4 100644 (file)
@@ -16,6 +16,7 @@
 
 #define PVR_POWER9             0x004E
 #define PVR_POWER10            0x0080
+#define PVR_POWER11            0x0082
 
 static const struct sample_reg sample_reg_masks[] = {
        SMPL_REG(r0, PERF_REG_POWERPC_R0),
@@ -207,7 +208,7 @@ uint64_t arch__intr_reg_mask(void)
        version = (((mfspr(SPRN_PVR)) >>  16) & 0xFFFF);
        if (version == PVR_POWER9)
                extended_mask = PERF_REG_PMU_MASK_300;
-       else if (version == PVR_POWER10)
+       else if ((version == PVR_POWER10) || (version == PVR_POWER11))
                extended_mask = PERF_REG_PMU_MASK_31;
        else
                return mask;