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

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/8/lib/libpmc/libpmc.c
Directory Properties:
  stable/8/lib/libpmc/   (props changed)

Modified: stable/8/lib/libpmc/libpmc.c
==============================================================================
--- stable/8/lib/libpmc/libpmc.c        Thu Sep 16 15:14:05 2010        
(r212739)
+++ stable/8/lib/libpmc/libpmc.c        Thu Sep 16 15:15:34 2010        
(r212740)
@@ -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;            \
_______________________________________________
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