aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFabien Thomas <fabient@FreeBSD.org>2010-09-16 15:15:34 +0000
committerFabien Thomas <fabient@FreeBSD.org>2010-09-16 15:15:34 +0000
commitcd238d746d26822dac3a42d64443196eda9c3a5c (patch)
treec99d966f64704046ca77d096fc3e2917f5ce2b8d /lib
parent04ef6ce881264e509ae639e0c41a49dcb88aa408 (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libpmc/libpmc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c
index 551fe12c7a359..915c8f4fb6223 100644
--- a/lib/libpmc/libpmc.c
+++ b/lib/libpmc/libpmc.c
@@ -2604,7 +2604,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
@@ -2617,9 +2618,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; \