Commit b1cef753 authored by Peter Zijlstra (Intel)'s avatar Peter Zijlstra (Intel) Committed by Giuliano Procida
Browse files

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: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250121152303.3128733-3-kan.liang@linux.intel.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit 887e39ac)
Bug: 437846539
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 97e1cd5d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment