Author: fabient
Date: Thu Sep 16 15:19:39 2010
New Revision: 212743
URL: http://svn.freebsd.org/changeset/base/212743

Log:
  MFC r212224:
  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.

Modified:
  stable/7/lib/libpmc/libpmc.c
Directory Properties:
  stable/7/lib/libpmc/   (props changed)

Modified: stable/7/lib/libpmc/libpmc.c
==============================================================================
--- stable/7/lib/libpmc/libpmc.c        Thu Sep 16 15:19:23 2010        
(r212742)
+++ stable/7/lib/libpmc/libpmc.c        Thu Sep 16 15:19:39 2010        
(r212743)
@@ -2597,7 +2597,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
 
@@ -2610,9 +2611,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;            \
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to