git: 73b7b181e691 - main - libpmc: Disable hardcoding of Intel fixed counters.

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Tue, 31 May 2022 00:05:23 UTC
The branch main has been updated by mav:

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

commit 73b7b181e691ebbe8a0e411fd60f5003b51dc75d
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-05-30 23:58:40 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-05-31 00:05:15 +0000

    libpmc: Disable hardcoding of Intel fixed counters.
    
    Intel json's now have pretty reasonable fixed counters representation
    via event=0 and umask.  Hardcoded values create more confusion than fix.
    
    MFC after:      1 month
---
 lib/libpmc/libpmc_pmu_util.c    | 3 +--
 lib/libpmc/pmu-events/jevents.c | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c
index 0f9fc0391589..765196ecc8ac 100644
--- a/lib/libpmc/libpmc_pmu_util.c
+++ b/lib/libpmc/libpmc_pmu_util.c
@@ -528,8 +528,7 @@ pmc_pmu_intel_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm,
 	    strcasestr(event_name, "uncore") != NULL) {
 		pm->pm_class = PMC_CLASS_UCP;
 		pm->pm_caps |= PMC_CAP_QUALIFIER;
-	} else if ((ped->ped_umask == -1) ||
-	    (ped->ped_event == 0x0 && ped->ped_umask == 0x3)) {
+	} else if (ped->ped_event == 0x0) {
 		pm->pm_class = PMC_CLASS_IAF;
 	} else {
 		pm->pm_class = PMC_CLASS_IAP;
diff --git a/lib/libpmc/pmu-events/jevents.c b/lib/libpmc/pmu-events/jevents.c
index 5a296031451e..ff7d3b226932 100644
--- a/lib/libpmc/pmu-events/jevents.c
+++ b/lib/libpmc/pmu-events/jevents.c
@@ -480,12 +480,14 @@ static struct fixed {
 	const char *name;
 	const char *event;
 } fixed[] = {
+#if 0
 	{ "inst_retired.any", "event=0xc0,period=2000003" },
 	{ "inst_retired.any_p", "event=0xc0,period=2000003" },
 	{ "cpu_clk_unhalted.ref", "event=0x0,umask=0x03,period=2000003" },
 	{ "cpu_clk_unhalted.thread", "event=0x3c,period=2000003" },
 	{ "cpu_clk_unhalted.core", "event=0x3c,period=2000003" },
 	{ "cpu_clk_unhalted.thread_any", "event=0x3c,any=1,period=2000003" },
+#endif
 	{ NULL, NULL},
 };