diff options
author | David S. Miller <davem@davemloft.net> | 2018-10-12 10:31:58 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-21 09:27:30 +0100 |
commit | 9190b06c4dbbf7fe1f0c337e35fa0969ba1ddf3d (patch) | |
tree | eff9f1c5bed79bdf3e610a38f25ce123d6467461 /lib/debug_locks.c | |
parent | 97b8ca659ab410c6955da052592959244d041fa8 (diff) |
sparc: Fix single-pcr perf event counter management.
[ Upstream commit cfdc3170d214046b9509183fe9b9544dc644d40b ]
It is important to clear the hw->state value for non-stopped events
when they are added into the PMU. Otherwise when the event is
scheduled out, we won't read the counter because HES_UPTODATE is still
set. This breaks 'perf stat' and similar use cases, causing all the
events to show zero.
This worked for multi-pcr because we make explicit sparc_pmu_start()
calls in calculate_multiple_pcrs(). calculate_single_pcr() doesn't do
this because the idea there is to accumulate all of the counter
settings into the single pcr value. So we have to add explicit
hw->state handling there.
Like x86, we use the PERF_HES_ARCH bit to track truly stopped events
so that we don't accidently start them on a reload.
Related to all of this, sparc_pmu_start() is missing a userpage update
so add it.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/debug_locks.c')
0 files changed, 0 insertions, 0 deletions