selftests/powerpc/pmu: Add mask/shift bits for extracting threshold compare field
authorKajol Jain <kjain@linux.ibm.com>
Fri, 10 Jun 2022 13:40:39 +0000 (19:10 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 28 Jun 2022 13:56:37 +0000 (23:56 +1000)
commit42e0576eec75479fa7709c41e5c3b9ec556b8f4d
treed881f73fba854197c84ce60565482c2010efccdf
parent890005a7d98f7452cfe86dcfb2aeeb7df01132ce
selftests/powerpc/pmu: Add mask/shift bits for extracting threshold compare field

In power10, threshold compare field is not part of the raw event code
and provided via event attribute config1. Hence add the mask and shift
bits based on event attribute config1, to extract the threshold compare
value for power10

Also add a new function called get_thresh_cmp_val to compute and return
the threshold compare field for a given platform, since incase of
power10, threshold compare value provided is decimal.

Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220610134113.62991-2-atrajeev@linux.vnet.ibm.com
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h