mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 21:35:07 +00:00
perf powerpc: Add support to expose instruction and data address registers as part of extended regs
This patch enables presenting Sampled Instruction Address Register (SIAR) and Sampled Data Address Register (SDAR) SPRs as part of extended registers for the perf tool. Add these SPR's to sample_reg_mask in the tool side (to use with -I? option). Reviewed-by: Kajol Jain <kjain@linux.ibm.com> Signed-off-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Nageswara R Sastry <rnsastry@linux.ibm.com> Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20211018114948.16830-3-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
637b8b90fe
commit
83e1ada67a
@ -61,17 +61,19 @@ enum perf_event_powerpc_regs {
|
||||
PERF_REG_POWERPC_PMC4,
|
||||
PERF_REG_POWERPC_PMC5,
|
||||
PERF_REG_POWERPC_PMC6,
|
||||
PERF_REG_POWERPC_SDAR,
|
||||
PERF_REG_POWERPC_SIAR,
|
||||
/* Max mask value for interrupt regs w/o extended regs */
|
||||
PERF_REG_POWERPC_MAX = PERF_REG_POWERPC_MMCRA + 1,
|
||||
/* Max mask value for interrupt regs including extended regs */
|
||||
PERF_REG_EXTENDED_MAX = PERF_REG_POWERPC_PMC6 + 1,
|
||||
PERF_REG_EXTENDED_MAX = PERF_REG_POWERPC_SIAR + 1,
|
||||
};
|
||||
|
||||
#define PERF_REG_PMU_MASK ((1ULL << PERF_REG_POWERPC_MAX) - 1)
|
||||
|
||||
/*
|
||||
* PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_300
|
||||
* includes 9 SPRS from MMCR0 to PMC6 excluding the
|
||||
* includes 11 SPRS from MMCR0 to SIAR excluding the
|
||||
* unsupported SPRS MMCR3, SIER2 and SIER3.
|
||||
*/
|
||||
#define PERF_REG_PMU_MASK_300 \
|
||||
@ -79,11 +81,12 @@ enum perf_event_powerpc_regs {
|
||||
(1ULL << PERF_REG_POWERPC_MMCR2) | (1ULL << PERF_REG_POWERPC_PMC1) | \
|
||||
(1ULL << PERF_REG_POWERPC_PMC2) | (1ULL << PERF_REG_POWERPC_PMC3) | \
|
||||
(1ULL << PERF_REG_POWERPC_PMC4) | (1ULL << PERF_REG_POWERPC_PMC5) | \
|
||||
(1ULL << PERF_REG_POWERPC_PMC6))
|
||||
(1ULL << PERF_REG_POWERPC_PMC6) | (1ULL << PERF_REG_POWERPC_SDAR) | \
|
||||
(1ULL << PERF_REG_POWERPC_SIAR))
|
||||
|
||||
/*
|
||||
* PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_31
|
||||
* includes 12 SPRs from MMCR0 to PMC6.
|
||||
* includes 14 SPRs from MMCR0 to SIAR.
|
||||
*/
|
||||
#define PERF_REG_PMU_MASK_31 \
|
||||
(PERF_REG_PMU_MASK_300 | (1ULL << PERF_REG_POWERPC_MMCR3) | \
|
||||
|
@ -77,6 +77,8 @@ static const char *reg_names[] = {
|
||||
[PERF_REG_POWERPC_PMC4] = "pmc4",
|
||||
[PERF_REG_POWERPC_PMC5] = "pmc5",
|
||||
[PERF_REG_POWERPC_PMC6] = "pmc6",
|
||||
[PERF_REG_POWERPC_SDAR] = "sdar",
|
||||
[PERF_REG_POWERPC_SIAR] = "siar",
|
||||
};
|
||||
|
||||
static inline const char *__perf_reg_name(int id)
|
||||
|
@ -74,6 +74,8 @@ const struct sample_reg sample_reg_masks[] = {
|
||||
SMPL_REG(pmc4, PERF_REG_POWERPC_PMC4),
|
||||
SMPL_REG(pmc5, PERF_REG_POWERPC_PMC5),
|
||||
SMPL_REG(pmc6, PERF_REG_POWERPC_PMC6),
|
||||
SMPL_REG(sdar, PERF_REG_POWERPC_SDAR),
|
||||
SMPL_REG(siar, PERF_REG_POWERPC_SIAR),
|
||||
SMPL_REG_END
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user