Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jul 2022 18:09:20 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b120f6d62572 - stable/13 - libpmc:	Disable hardcoding of Intel fixed counters.
Message-ID:  <202207041809.264I9KYL064354@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mav:

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

commit b120f6d625723a2f412c11199050399ed1356b4a
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-05-30 23:58:40 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-07-04 17:48:09 +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
    
    (cherry picked from commit 73b7b181e691ebbe8a0e411fd60f5003b51dc75d)
---
 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 363f93c591f8..44487924c7d6 100644
--- a/lib/libpmc/libpmc_pmu_util.c
+++ b/lib/libpmc/libpmc_pmu_util.c
@@ -521,8 +521,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},
 };
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207041809.264I9KYL064354>