Author: jkoshy
Date: Sun Nov 16 04:26:38 2008
New Revision: 184998
URL: http://svn.freebsd.org/changeset/base/184998

Log:
  Ignore absent CPUs when listing the current state of PMC hardware.

Modified:
  head/usr.sbin/pmccontrol/pmccontrol.c

Modified: head/usr.sbin/pmccontrol/pmccontrol.c
==============================================================================
--- head/usr.sbin/pmccontrol/pmccontrol.c       Sun Nov 16 04:21:59 2008        
(r184997)
+++ head/usr.sbin/pmccontrol/pmccontrol.c       Sun Nov 16 04:26:38 2008        
(r184998)
@@ -256,9 +256,12 @@ pmcc_do_list_state(void)
                    (logical_cpus_mask & (1 << cpu)))
                        continue; /* skip P4-style 'logical' cpus */
 #endif
-               if (pmc_pmcinfo(cpu, &pi) < 0)
+               if (pmc_pmcinfo(cpu, &pi) < 0) {
+                       if (errno == ENXIO)
+                               continue;
                        err(EX_OSERR, "Unable to get PMC status for CPU %d",
                            cpu);
+               }
 
                printf("#CPU %d:\n", c++);
                npmc = pmc_npmc(cpu);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to