From owner-svn-src-head@freebsd.org Tue Sep 1 17:52:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 665C69C70E2; Tue, 1 Sep 2015 17:52:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5755222C; Tue, 1 Sep 2015 17:52:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81HqiYn024258; Tue, 1 Sep 2015 17:52:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81HqiM6024257; Tue, 1 Sep 2015 17:52:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509011752.t81HqiM6024257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 1 Sep 2015 17:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287374 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Sep 2015 17:52:44 -0000 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;