git: 0cd1f9831c65 - stable/13 - libpmc: Fix INVERT flag mapping for both Intel and AMD.

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Mon, 04 Jul 2022 18:09:23 UTC
The branch stable/13 has been updated by mav:

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

commit 0cd1f9831c658628a191fc511bb62682dfcf3bba
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-05-31 04:02:06 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-07-04 17:48:09 +0000

    libpmc: Fix INVERT flag mapping for both Intel and AMD.
    
    Looks like somebody's trivial copy/paste bug.
    
    MFC after:      1 month
    
    (cherry picked from commit 037dd0a9677144a870a381a1bbccbe61e34628dd)
---
 lib/libpmc/libpmc_pmu_util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c
index 44487924c7d6..6830a2457364 100644
--- a/lib/libpmc/libpmc_pmu_util.c
+++ b/lib/libpmc/libpmc_pmu_util.c
@@ -503,7 +503,7 @@ pmc_pmu_amd_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm,
 		if (ped->ped_edge)
 			amd->pm_amd_config |= AMD_PMC_EDGE;
 		if (ped->ped_inv)
-			amd->pm_amd_config |= AMD_PMC_EDGE;
+			amd->pm_amd_config |= AMD_PMC_INVERT;
 		if (pm->pm_caps & PMC_CAP_INTERRUPT)
 			amd->pm_amd_config |= AMD_PMC_INT;
 	}
@@ -546,7 +546,7 @@ pmc_pmu_intel_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm,
 	if (ped->ped_any)
 		iap->pm_iap_config |= IAP_ANY;
 	if (ped->ped_inv)
-		iap->pm_iap_config |= IAP_EDGE;
+		iap->pm_iap_config |= IAP_INV;
 	if (pm->pm_caps & PMC_CAP_INTERRUPT)
 		iap->pm_iap_config |= IAP_INT;
 	return (0);