linux-yocto/kernel/events
Peter Zijlstra (Intel) 887e39ac47 perf: Avoid the read if the count is already updated
[ Upstream commit 8ce939a0fa194939cc1f92dbd8bc1a7806e7d40a ]

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.

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>
2025-05-29 11:03:02 +02:00
..
callchain.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
core.c perf: Avoid the read if the count is already updated 2025-05-29 11:03:02 +02:00
hw_breakpoint_test.c perf/hw_breakpoint: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:52 -07:00
hw_breakpoint.c perf/hw_breakpoint: Return EOPNOTSUPP for unsupported breakpoint type 2025-05-29 11:02:32 +02:00
internal.h perf/core: Add aux_pause, aux_resume, aux_start_paused 2025-04-20 10:15:10 +02:00
Makefile perf/hw_breakpoint: Add KUnit test for constraints accounting 2022-08-30 10:56:20 +02:00
ring_buffer.c perf: Avoid the read if the count is already updated 2025-05-29 11:03:02 +02:00
uprobes.c uprobes/x86: Harden uretprobe syscall trampoline check 2025-04-10 14:39:37 +02:00