UPSTREAM: perf: Avoid the read if the count is already updated
[ Upstream commit 8ce939a0 ] The event may have been updated in the PMU-specific implementation, e.g., Intel PEBS counters snapshotting. The common code should not read and overwrite the value. The PERF_SAMPLE_READ in the data->sample_type can be used to detect whether the PMU-specific value is available. If yes, avoid the pmu->read() in the common code. Add a new flag, skip_read, to track the case. Factor out a perf_pmu_read() to clean up the code. Change-Id: I6b616aff88b80af65e8a7ef7779df044c6078269 Signed-off-by:Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by:
Kan Liang <kan.liang@linux.intel.com> Signed-off-by:
Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20250121152303.3128733-3-kan.liang@linux.intel.com Signed-off-by:
Sasha Levin <sashal@kernel.org> (cherry picked from commit 887e39ac) Bug: 437846539 Signed-off-by:
Greg Kroah-Hartman <gregkh@google.com>
Loading