Commit 0349164
committed
perf: Avoid the read if the count is already updated
JIRA: https://issues.redhat.com/browse/RHEL-47444
upstream
========
commit 8ce939a
Author: Peter Zijlstra (Intel) <peterz@infradead.org>
Date: Tue Jan 21 07:23:02 2025 -0800
description
===========
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: Michael Petlan <mpetlan@redhat.com>1 parent f8df957 commit 0349164
File tree
3 files changed
+24
-18
lines changed- include/linux
- kernel/events
3 files changed
+24
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1041 | 1041 | | |
1042 | 1042 | | |
1043 | 1043 | | |
1044 | | - | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
1045 | 1051 | | |
1046 | 1052 | | |
1047 | 1053 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1195 | 1195 | | |
1196 | 1196 | | |
1197 | 1197 | | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1198 | 1204 | | |
1199 | 1205 | | |
1200 | 1206 | | |
| |||
3473 | 3479 | | |
3474 | 3480 | | |
3475 | 3481 | | |
3476 | | - | |
3477 | | - | |
| 3482 | + | |
3478 | 3483 | | |
3479 | 3484 | | |
3480 | 3485 | | |
| |||
4624 | 4629 | | |
4625 | 4630 | | |
4626 | 4631 | | |
4627 | | - | |
4628 | | - | |
4629 | | - | |
4630 | | - | |
4631 | | - | |
4632 | | - | |
4633 | | - | |
4634 | | - | |
4635 | | - | |
| 4632 | + | |
| 4633 | + | |
4636 | 4634 | | |
4637 | 4635 | | |
4638 | 4636 | | |
| |||
7399 | 7397 | | |
7400 | 7398 | | |
7401 | 7399 | | |
7402 | | - | |
7403 | | - | |
7404 | | - | |
| 7400 | + | |
| 7401 | + | |
7405 | 7402 | | |
7406 | 7403 | | |
7407 | 7404 | | |
| |||
7414 | 7411 | | |
7415 | 7412 | | |
7416 | 7413 | | |
7417 | | - | |
7418 | | - | |
7419 | | - | |
| 7414 | + | |
| 7415 | + | |
7420 | 7416 | | |
7421 | 7417 | | |
7422 | 7418 | | |
| |||
7475 | 7471 | | |
7476 | 7472 | | |
7477 | 7473 | | |
| 7474 | + | |
| 7475 | + | |
| 7476 | + | |
7478 | 7477 | | |
7479 | 7478 | | |
7480 | 7479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| |||
0 commit comments