Files
linux/arch/sparc/kernel
David S. Miller 4c04e74c69 sparc: Fix single-pcr perf event counter management.
[ Upstream commit cfdc3170d2 ]

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>
2018-11-13 11:16:47 -08:00
..
2014-05-18 19:01:30 -07:00
2014-05-18 19:01:29 -07:00
2018-06-06 16:44:38 +02:00
2016-08-07 23:55:43 -04:00
2016-08-07 23:55:43 -04:00
2016-08-07 23:55:43 -04:00
2016-11-18 11:16:59 -08:00
2016-08-07 23:55:43 -04:00
2016-11-18 11:17:00 -08:00
2016-07-27 22:53:17 -07:00
2017-06-14 15:05:54 +02:00
2018-04-13 19:48:27 +02:00
2015-03-19 10:17:22 -05:00
2016-08-07 23:55:43 -04:00
2014-08-26 13:45:55 -04:00
2015-03-19 18:54:49 -07:00
2013-06-13 22:12:14 +01:00
2012-03-28 18:30:03 +01:00
2014-08-26 13:45:55 -04:00
2014-07-21 22:27:56 -07:00
2016-03-20 21:28:58 -07:00
2017-06-14 15:05:54 +02:00
2014-09-30 14:17:08 -07:00