diff options
author | fabient <fabient@FreeBSD.org> | 2010-09-05 13:31:14 +0000 |
---|---|---|
committer | fabient <fabient@FreeBSD.org> | 2010-09-05 13:31:14 +0000 |
commit | dd461c3739e3026d957917c95209144d72f5099e (patch) | |
tree | 61dd378bccda0f3805dc1efcfda6662cb9f51320 /lib/libpmc | |
parent | 4f9dee93a3dcb7d781a21fc8f8fa17c4de77b187 (diff) | |
download | FreeBSD-src-dd461c3739e3026d957917c95209144d72f5099e.zip FreeBSD-src-dd461c3739e3026d957917c95209144d72f5099e.tar.gz |
Fix invalid class removal when IAF is not the last class.
Keep IAF class with 0 PMC and change the alias in libpmc to IAP.
MFC after: 1 week
Diffstat (limited to 'lib/libpmc')
-rw-r--r-- | lib/libpmc/libpmc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c index 8922dd8..1d86a82 100644 --- a/lib/libpmc/libpmc.c +++ b/lib/libpmc/libpmc.c @@ -2695,7 +2695,8 @@ pmc_init(void) */ cpu_has_iaf_counters = 0; for (t = 0; t < cpu_info.pm_nclass; t++) - if (cpu_info.pm_classes[t].pm_class == PMC_CLASS_IAF) + if (cpu_info.pm_classes[t].pm_class == PMC_CLASS_IAF && + cpu_info.pm_classes[t].pm_num > 0) cpu_has_iaf_counters = 1; #endif @@ -2708,9 +2709,8 @@ pmc_init(void) #define PMC_MDEP_INIT_INTEL_V2(C) do { \ PMC_MDEP_INIT(C); \ - if (cpu_has_iaf_counters) \ - pmc_class_table[n++] = &iaf_class_table_descr; \ - else \ + pmc_class_table[n++] = &iaf_class_table_descr; \ + if (!cpu_has_iaf_counters) \ pmc_mdep_event_aliases = \ C##_aliases_without_iaf; \ pmc_class_table[n] = &C##_class_table_descr; \ |