selftests/powerpc/pmu/: Add interface test for mmcr2_fcs_fch fields
authorMadhavan Srinivasan <maddy@linux.ibm.com>
Thu, 27 Jan 2022 07:20:10 +0000 (12:50 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 1 Mar 2022 12:40:36 +0000 (23:40 +1100)
commit9ee241f1b1447c7e8ca90902ab1888aa9e7a3c00
treeca9979653fcf1bbde1029c9a71e6355d66c26210
parentac575b2606bf99a0d01a054196e24e1ad82c194d
selftests/powerpc/pmu/: Add interface test for mmcr2_fcs_fch fields

The testcases uses cycles event to verify the freeze counter settings in
Monitor Mode Control Register 2 (MMCR2). Event modifier (exclude_kernel)
setting is used for the event attribute to check the FCxS and FCxH (
Freeze counter in privileged and hypervisor state ) settings via perf
interface.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
[mpe: Add error checking, check MSR for MSR_HV, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-19-kjain@linux.ibm.com
tools/testing/selftests/powerpc/pmu/sampling_tests/.gitignore
tools/testing/selftests/powerpc/pmu/sampling_tests/Makefile
tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr2_fcs_fch_test.c [new file with mode: 0644]