Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Sep 2010 15:15:34 +0000 (UTC)
From:      Fabien Thomas <fabient@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r212740 - stable/8/lib/libpmc
Message-ID:  <201009161515.o8GFFYAl095630@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;		\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009161515.o8GFFYAl095630>