Commit 950ecdc
perf/x86/intel: Fix broken fixed event constraints extension
Unnecessary multiplexing is triggered when running an "instructions"
event on an MTL.
perf stat -e cpu_core/instructions/,cpu_core/instructions/ -a sleep 1
Performance counter stats for 'system wide':
115,489,000 cpu_core/instructions/ (50.02%)
127,433,777 cpu_core/instructions/ (49.98%)
1.002294504 seconds time elapsed
Linux architectural perf events, e.g., cycles and instructions, usually
have dedicated fixed counters. These events also have equivalent events
which can be used in the general-purpose counters. The counters are
precious. In the intel_pmu_check_event_constraints(), perf check/extend
the event constraints of these events. So these events can utilize both
fixed counters and general-purpose counters.
The following cleanup commit:
97588df ("perf/x86/intel: Add common intel_pmu_init_hybrid()")
forgot adding the intel_pmu_check_event_constraints() into update_pmu_cap().
The architectural perf events cannot utilize the general-purpose counters.
The code to check and update the counters, event constraints and
extra_regs is the same among hybrid systems. Move
intel_pmu_check_hybrid_pmus() to init_hybrid_pmu(), and
emove the duplicate check in update_pmu_cap().
Fixes: 97588df ("perf/x86/intel: Add common intel_pmu_init_hybrid()")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230911135128.2322833-1-kan.liang@linux.intel.com1 parent 97588df commit 950ecdc
1 file changed
+26
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4598 | 4598 | | |
4599 | 4599 | | |
4600 | 4600 | | |
| 4601 | + | |
| 4602 | + | |
| 4603 | + | |
| 4604 | + | |
| 4605 | + | |
| 4606 | + | |
| 4607 | + | |
4601 | 4608 | | |
4602 | 4609 | | |
4603 | 4610 | | |
| |||
4618 | 4625 | | |
4619 | 4626 | | |
4620 | 4627 | | |
4621 | | - | |
4622 | | - | |
4623 | | - | |
4624 | | - | |
4625 | | - | |
4626 | | - | |
4627 | 4628 | | |
4628 | 4629 | | |
4629 | 4630 | | |
4630 | 4631 | | |
4631 | 4632 | | |
4632 | 4633 | | |
4633 | 4634 | | |
| 4635 | + | |
| 4636 | + | |
| 4637 | + | |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
| 4644 | + | |
4634 | 4645 | | |
4635 | 4646 | | |
4636 | 4647 | | |
| |||
4641 | 4652 | | |
4642 | 4653 | | |
4643 | 4654 | | |
| 4655 | + | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
| 4660 | + | |
| 4661 | + | |
4644 | 4662 | | |
4645 | 4663 | | |
4646 | 4664 | | |
| |||
4696 | 4714 | | |
4697 | 4715 | | |
4698 | 4716 | | |
| 4717 | + | |
| 4718 | + | |
4699 | 4719 | | |
4700 | 4720 | | |
4701 | 4721 | | |
| |||
5915 | 5935 | | |
5916 | 5936 | | |
5917 | 5937 | | |
5918 | | - | |
5919 | | - | |
5920 | | - | |
5921 | | - | |
5922 | | - | |
5923 | | - | |
5924 | | - | |
5925 | | - | |
5926 | | - | |
5927 | | - | |
5928 | | - | |
5929 | | - | |
5930 | | - | |
5931 | | - | |
5932 | | - | |
5933 | | - | |
5934 | | - | |
5935 | | - | |
5936 | | - | |
5937 | | - | |
5938 | | - | |
5939 | | - | |
5940 | | - | |
5941 | | - | |
5942 | | - | |
5943 | | - | |
5944 | | - | |
5945 | | - | |
5946 | | - | |
5947 | | - | |
5948 | 5938 | | |
5949 | 5939 | | |
5950 | 5940 | | |
| |||
6869 | 6859 | | |
6870 | 6860 | | |
6871 | 6861 | | |
6872 | | - | |
6873 | | - | |
6874 | | - | |
6875 | 6862 | | |
6876 | 6863 | | |
6877 | 6864 | | |
| |||
0 commit comments