powerpc/perf: Fix thresholding counter data for unknown type
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
Sun, 9 Dec 2018 09:18:15 +0000 (14:48 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:47:14 +0000 (19:47 +0100)
commit5a0c7fb5332a4e879548d6c9ca1fb3f2abf2702f
treefbbc219aaad6afe76d99f013b890e4794147e48c
parentd5e2df9ff5079b52d22a98bb74b95bb0df602b65
powerpc/perf: Fix thresholding counter data for unknown type

[ Upstream commit 17cfccc91545682513541924245abb876d296063 ]

MMCRA[34:36] and MMCRA[38:44] expose the thresholding counter value.
Thresholding counter can be used to count latency cycles such as
load miss to reload. But threshold counter value is not relevant
when the sampled instruction type is unknown or reserved. Patch to
fix the thresholding counter value to zero when sampled instruction
type is unknown or reserved.

Fixes: 170a315f41c6('powerpc/perf: Support to export MMCRA[TEC*] field to userspace')
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/perf/isa207-common.c