From e144cd92bb150b5636f97af3c1c89da49edf8ac8 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 2 Jun 2022 15:09:38 -0400 Subject: [PATCH] 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"},