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
This commit is contained in:
Alexander Motin 2022-06-02 15:09:38 -04:00
parent 56b64e28e1
commit e144cd92bb

View file

@ -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"},