Author: jhb
Date: Tue Sep  1 17:52:43 2015
New Revision: 287374
URL: https://svnweb.freebsd.org/changeset/base/287374

Log:
  Fix an off by one error in r283613:  Like regular ffs(), CPU_FFS() returns
  1 for CPU 0, etc. so the return value must be decremented to obtain the
  first valid CPU ID.
  
  Submitted by: fabient
  MFC after:    1 week

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

Modified: head/usr.sbin/pmcstat/pmcstat.c
==============================================================================
--- head/usr.sbin/pmcstat/pmcstat.c     Tue Sep  1 17:13:04 2015        
(r287373)
+++ head/usr.sbin/pmcstat/pmcstat.c     Tue Sep  1 17:52:43 2015        
(r287374)
@@ -769,7 +769,7 @@ main(int argc, char **argv)
                                ev->ev_count = -1;
 
                        if (option == 'S' || option == 's')
-                               ev->ev_cpu = CPU_FFS(&cpumask);
+                               ev->ev_cpu = CPU_FFS(&cpumask) - 1;
                        else
                                ev->ev_cpu = PMC_CPU_ANY;
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to