svn commit: r287374 - head/usr.sbin/pmcstat

John Baldwin jhb at FreeBSD.org
Tue Sep 1 17:52:44 UTC 2015


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;
 


More information about the svn-src-head mailing list