]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/powerpc/pmu: Add selftest for PERF_TYPE_HARDWARE events valid check
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Fri, 10 Jun 2022 13:41:06 +0000 (19:11 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 28 Jun 2022 22:57:44 +0000 (08:57 +1000)
commitf7f005643a114c307c41d2122807f4f55048e6d7
treec6fee7fe5c0ea76bae950caa6726710157cca2b4
parent19753d0a10bd40549e19cbf34ead4719815e5844
selftests/powerpc/pmu: Add selftest for PERF_TYPE_HARDWARE events valid check

Testcase to ensure that using invalid event in generic event for
PERF_TYPE_HARDWARE will fail. Invalid generic events in power10 are:
- PERF_COUNT_HW_BUS_CYCLES
- PERF_COUNT_HW_STALLED_CYCLES_FRONTEND
- PERF_COUNT_HW_STALLED_CYCLES_BACKEND
- PERF_COUNT_HW_REF_CPU_CYCLES

Invalid generic events in power9 are:
- PERF_COUNT_HW_BUS_CYCLES
- PERF_COUNT_HW_REF_CPU_CYCLES

Testcase does event open for valid and invalid generic events to ensure
event open works for all valid events and fails for invalid events.

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220610134113.62991-29-atrajeev@linux.vnet.ibm.com
tools/testing/selftests/powerpc/pmu/event_code_tests/Makefile
tools/testing/selftests/powerpc/pmu/event_code_tests/generic_events_valid_test.c [new file with mode: 0644]