git: e144cd92bb15 - main - libpmc: Prefer fixed counters in Intel event aliases.

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Thu, 02 Jun 2022 19:17:33 UTC
The branch main has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=e144cd92bb150b5636f97af3c1c89da49edf8ac8

commit e144cd92bb150b5636f97af3c1c89da49edf8ac8
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-06-02 19:09:38 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-06-02 19:17:13 +0000

    libpmc: Prefer fixed counters in Intel event aliases.
    
    It is recommended by Intel to use fixed counters when possible to
    leave programmable ones for different events.
    
    This fixes `pmc stat`, which tries to count 6 events same time, while
    many Intel CPUs have only 4 programmable counters.
    
    MFC after:      1 month
---
 lib/libpmc/libpmc_pmu_util.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c
index a7c090ceb4d3..7af6d813ada6 100644
--- a/lib/libpmc/libpmc_pmu_util.c
+++ b/lib/libpmc/libpmc_pmu_util.c
@@ -60,8 +60,8 @@ typedef enum {
 } pmu_mfr_t;
 
 static struct pmu_alias pmu_intel_alias_table[] = {
-	{"UNHALTED_CORE_CYCLES", "CPU_CLK_UNHALTED.THREAD_P_ANY"},
-	{"UNHALTED-CORE-CYCLES", "CPU_CLK_UNHALTED.THREAD_P_ANY"},
+	{"UNHALTED_CORE_CYCLES", "cpu_clk_unhalted.thread"},
+	{"UNHALTED-CORE-CYCLES", "cpu_clk_unhalted.thread"},
 	{"LLC_MISSES", "LONGEST_LAT_CACHE.MISS"},
 	{"LLC-MISSES", "LONGEST_LAT_CACHE.MISS"},
 	{"LLC_REFERENCE", "LONGEST_LAT_CACHE.REFERENCE"},
@@ -74,8 +74,8 @@ static struct pmu_alias pmu_intel_alias_table[] = {
 	{"BRANCH-INSTRUCTION-RETIRED", "BR_INST_RETIRED.ALL_BRANCHES"},
 	{"BRANCH_MISSES_RETIRED", "BR_MISP_RETIRED.ALL_BRANCHES"},
 	{"BRANCH-MISSES-RETIRED", "BR_MISP_RETIRED.ALL_BRANCHES"},
-	{"unhalted-cycles", "CPU_CLK_UNHALTED.THREAD_P_ANY"},
-	{"instructions", "inst_retired.any_p"},
+	{"unhalted-cycles", "cpu_clk_unhalted.thread"},
+	{"instructions", "inst_retired.any"},
 	{"branch-mispredicts", "br_misp_retired.all_branches"},
 	{"branches", "br_inst_retired.all_branches"},
 	{"interrupts", "hw_interrupts.received"},